Skip to content

Commit

Permalink
check for including state in unsatisfied message
Browse files Browse the repository at this point in the history
  • Loading branch information
nitishr committed Dec 25, 2019
1 parent 5946896 commit 031309f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/acceptance/multiple_expectations_failure_message_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,20 @@ def test_should_report_multiple_satisfied_expectations
'- expected exactly once, invoked once: #<Mock:mock>.method_one(any_parameters)'
], test_result.failure_message_lines
end

def test_should_include_state_in_unsatisfied_expectation_message
test_result = run_as_test do
mock = mock('mock')
readiness = states('readiness')
mock.expects(:method_one).once.then(readiness.is('ready'))
end
assert_failed(test_result)
assert_equal [
'not all expectations were satisfied',
'unsatisfied expectations:',
'- expected exactly once, invoked never: #<Mock:mock>.method_one(any_parameters)',
'states:',
'- readiness has no current state'
], test_result.failure_message_lines
end
end

0 comments on commit 031309f

Please sign in to comment.