You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a situation today where I want to group expectations for a range of inputs to a function. Some inputs should give a return value a, other inputs should give return value b. I thought I could group these assertions with an Invariant but since I lack a Then the tests are never executed.
Pseudo suite:
describe 'I want the same result for different inputs', ->
When -> @subject @input
Invariant -> expect(@result).toBe 'the same'
describe '- input foo', ->
Given -> @input = foo
describe '- input bar', ->
Given -> @input = bar
Would it be possible to make an Invariant enough to run the code inside all affected describe blocks?
The text was updated successfully, but these errors were encountered:
I am not sure I agree, but I do understand that a test branch with no Then statements can be confusing.
On Mon, Mar 17, 2014 at 10:01 AM, Ludwig Magnusson [email protected] wrote:
I encountered a situation today where I want to group expectations for a range of inputs to a function. Some inputs should give a return value a, other inputs should give return value b. I thought I could group these assertions with an Invariant but since I lack a Then the tests are never executed.
Pseudo suite:
describe 'I want the same result for different inputs', ->
When -> @subject @input
Invariant -> expect(@result).toBe 'the same'
describe '- input foo', ->
Given -> @input = foo
describe '- input bar', ->
Given -> @input = bar
Would it be possible to make an Invariant enough to run the code inside all affected describe blocks?
Reply to this email directly or view it on GitHub: #28
I encountered a situation today where I want to group expectations for a range of inputs to a function. Some inputs should give a return value
a
, other inputs should give return valueb
. I thought I could group these assertions with anInvariant
but since I lack aThen
the tests are never executed.Pseudo suite:
Would it be possible to make an
Invariant
enough to run the code inside all affecteddescribe
blocks?The text was updated successfully, but these errors were encountered: