#!/usr/bin/env ruby require 'test/unit' require 'flexmock' class TestTuIntegrationMockVerificationInTeardown < Test::Unit::TestCase include FlexMock::TestCase def teardown assert_raise(Test::Unit::AssertionFailedError) do super end end def test_mock_verification_occurs_during_teardown flexmock("xyz").should_receive(:hi).with(any).once end end class TestTuIntegrationMockVerificationWithoutSetup < Test::Unit::TestCase include FlexMock::TestCase def teardown assert_raise(Test::Unit::AssertionFailedError) do super end end def test_mock_verification_occurs_during_teardown flexmock("xyz").should_receive(:hi).with(any).once end end class TestTuIntegrationMockVerificationForgetfulSetup < Test::Unit::TestCase include FlexMock::TestCase def teardown assert_raise(Test::Unit::AssertionFailedError) do super end end def test_mock_verification_occurs_during_teardown flexmock("xyz").should_receive(:hi).with(any).once end end class TestTuIntegrationSetupOverridenAndNoMocksOk < Test::Unit::TestCase include FlexMock::TestCase 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