floehopper/mocha — Issue #60: Sequencing failure messages are unclear
Author: dchelimsky
Created: 2012-01-31 11:55:52+00:00
State: open

Given this example:

```ruby
require "test/unit"
require "mocha"

class FooTest < Test::Unit::TestCase
def test_foo
sequence = sequence(:task_order)
task_one = mock("task_one")
task_two = mock("task_two")

task_one.expects(:execute).in_sequence(sequence)
task_two.expects(:execute).in_sequence(sequence)

task_two.execute
task_one.execute
end
end
```

The failure message is unclear:

```
1) Failure:
test_foo(FooTest) [example_spec.rb:13]:
unexpected invocation: #.execute()
unsatisfied expectations:
- expected exactly once, not yet invoked: #.execute(any_parameters); in sequence :task_order
- expected exactly once, not yet invoked: #.execute(any_parameters); in sequence :task_order
```

I'd propose something like this:

```
1) Failure:
test_foo(FooTest) [example_spec.rb:13]:
invocation: #.execute() received out of order
```