CFC-Servers / CFC-Servers/GLuaTest
Add some way to aggregate expectation failures within a block
- Dominant language
- Lua
- Stars
- 87
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes if you need to run a lot of expectations, you want to know about all of the failures rather than just the first one.
Ruby's RSpec accomplishes this like so:
```rb
it "returns success response from stripe" do
aggregate_failures "stripe response" do
expect(refund.amount).to eq 100
expect(refund.status).to eq "succeeded"
expect(refund.id).to start_with "re_"
end
end
```
Ruby has the blessing of lots of block contexts, but we could maybe mimic that feature like so:
```lua
aggregateFailures( "stripe response", function()
expect( refund.amount ).to.equal( 100 )
expect( refund.status ).to.equal( "succeeded" )
expect( string.StartsWith( refund.id, "re_" ) ).to.beTrue()
end )
```
No doubt a nightmare to implement in the current runner code (bump on https://github.com/CFC-Servers/GLuaTest/issues/24)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.