Created
May 27, 2010 03:59
-
-
Save bodhi/415440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pasokun:myasics bodhi$ ruby -Itest test/m_test.rb | |
Loaded suite test/m_test | |
Started | |
..E | |
Finished in 0.002001 seconds. | |
1) Error: | |
test_mock_should_fail(MTest): | |
Mocha::ExpectationError: unexpected invocation: #<Object:0x109c3fc30>.to_s() | |
unsatisfied expectations: | |
- expected exactly once, not yet invoked: #<Object:0x109c43678>.to_s(any_parameters) | |
satisfied expectations: | |
- expected exactly once, already invoked once: #<Object:0x109c41a08>.to_s(any_parameters) | |
- expected exactly once, already invoked once: #<Object:0x109c3fc30>.to_s(any_parameters) | |
test/m_test.rb:16:in `test_mock_should_fail' | |
3 tests, 0 assertions, 0 failures, 1 errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "test_helper" | |
class MTest < Test::Unit::TestCase | |
def setup | |
@o = Object.new | |
@o.expects(:to_s).once | |
end | |
def test_mock_good | |
@o.to_s | |
end | |
def test_mock_should_fail | |
@o.to_s | |
@o.to_s | |
end | |
def test_mock_doesnt_fail | |
@o.object_id | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment