test/stubba_integration_test.rb in mocha-0.3.1 vs test/stubba_integration_test.rb in mocha-0.3.2
- old
+ new
@@ -9,15 +9,15 @@
class DontMessWithMe
def self.method_x
:original_return_value
end
end
-
+
def test_should_stub_class_method_within_test
test_class = Class.new(Test::Unit::TestCase) do
- include MultipleSetupAndTeardown
- include SetupAndTeardown
+ include SmartTestCase::MultipleSetupAndTeardown
+ include Stubba::SetupAndTeardown
define_method(:test_me) do
DontMessWithMe.expects(:method_x).returns(:new_return_value)
assert_equal :new_return_value, DontMessWithMe.method_x
end
end
@@ -28,12 +28,12 @@
assert test_result.passed?
end
def test_should_leave_stubbed_class_unchanged_after_test
test_class = Class.new(Test::Unit::TestCase) do
- include MultipleSetupAndTeardown
- include SetupAndTeardown
+ include SmartTestCase::MultipleSetupAndTeardown
+ include Stubba::SetupAndTeardown
define_method(:test_me) do
DontMessWithMe.expects(:method_x).returns(:new_return_value)
end
end
test = test_class.new(:test_me)
@@ -42,11 +42,11 @@
assert_equal :original_return_value, DontMessWithMe.method_x
end
def test_should_reset_expectations_after_test
test_class = Class.new(Test::Unit::TestCase) do
- include MultipleSetupAndTeardown
- include SetupAndTeardown
+ include SmartTestCase::MultipleSetupAndTeardown
+ include Stubba::SetupAndTeardown
define_method(:test_me) do
DontMessWithMe.expects(:method_x)
end
end
test = test_class.new(:test_me)
\ No newline at end of file