Skip to content

Instantly share code, notes, and snippets.

@erithmetic
Created November 8, 2011 20:58
Show Gist options
  • Save erithmetic/1349199 to your computer and use it in GitHub Desktop.
Save erithmetic/1349199 to your computer and use it in GitHub Desktop.
Started
E
Finished in 1.012821 seconds.
1) Error:
test_0001_underscored_version_of_your_it_statement(CamelizedDescription):
MockExpectationError: expected create, {:retval=>nil, :args=>["foo", "bar", {}]}
test/my_test.rb:25:in `block (2 levels) in <main>'
1 tests, 0 assertions, 0 failures, 1 errors, 0 skips
it 'does stuff' do
mock = MiniTest::Mock.new
mock.expect(:create, nil, ['foo', 'bar', {}])
@subject.thing = mock
@subject.work
mock.verify
end
@erithmetic
Copy link
Author

All the while I could use rspec:

it 'does stuff' do
  @subject.should_receive(:thing).with('foo', 'bar', {})
  @subject.work
 end

@hypomodern
Copy link

:fistbump:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment