3 ms·
Jim Weirich wrote rspec-given. This gem allows one to write really nice assertions: Given { @stack = Stack.new } When { @stack.push(1) } Then { @st
by FrancoisBosun 5y ago
Jim Weirich wrote rspec-given. This gem allows one to write really nice assertions:
Given { @stack = Stack.new }
When { @stack.push(1) }
Then { @stack.peek == 1 }
And { @stack.size == 1 }
What you wish for is embedded in When and And. Check it out: https://github.com/jimweirich/rspec-given https://github.com/jimweirich/rspec-given
- jamie_ca 5y agoThe biggest benefit in my mind of rspec-given is that it allows you to combine the speed benefits of running the test setup once (When) with the clarity of granular assertions that report failures independently (Then).