test/test_tu_integration.rb in flexmock-0.3.0 vs test/test_tu_integration.rb in flexmock-0.3.1
- old
+ new
@@ -4,14 +4,10 @@
require 'flexmock'
class TestTuIntegrationMockVerificationInTeardown < Test::Unit::TestCase
include FlexMock::TestCase
- def setup
- super
- end
-
def teardown
assert_raise(Test::Unit::AssertionFailedError) do
super
end
end
@@ -36,13 +32,10 @@
end
class TestTuIntegrationMockVerificationForgetfulSetup < Test::Unit::TestCase
include FlexMock::TestCase
- def setup
- end
-
def teardown
assert_raise(Test::Unit::AssertionFailedError) do
super
end
end
@@ -53,11 +46,23 @@
end
class TestTuIntegrationSetupOverridenAndNoMocksOk < Test::Unit::TestCase
include FlexMock::TestCase
- def setup
+ def test_mock_verification_occurs_during_teardown
end
+end
+class TestTuIntegrationFailurePreventsVerification < Test::Unit::TestCase
+ include FlexMock::TestCase
+
def test_mock_verification_occurs_during_teardown
+ flexmock('m').should_receive(:hi).once
+ simulate_failure
+ end
+
+ private
+
+ def simulate_failure
+ @test_passed = false
end
end