After updating Mocha from version 2.1.0 to 2.2.0, a test began to fail with the following output:
$ bin/rails test test/unit/issue_test.rb:704
Run options: --seed 38306
# Running:
F
Failure:
IssueTest#test_assigning_attributes_should_assign_project_and_tracker_first [app/models/issue.rb:478]:
unexpected invocation: subject=(Test)
bin/rails test test/unit/issue_test.rb:704
Category changed from Gems support to Code cleanup/refactoring
Below is the test code that currently fails. The three lines of issue.expects expect that the three methods :project_id=, :tracker_id=, and :subject= are called in this order. However, it is :subject= that is called first because issue.attributes = {:subject => 'Test'} is executed first. It is curious that this code worked with Mocha 2.1.