Sha256: 77d5ada74363c7843daa39020f1e602ac6e3b622a92da8810cf9b270eb11847c
Contents?: true
Size: 1.33 KB
Versions: 46
Compression:
Stored size: 1.33 KB
Contents
require File.expand_path('../acceptance_test_helper', __FILE__) require 'mocha' class Issue70Test < Test::Unit::TestCase include AcceptanceTest def setup setup_acceptance_test end def teardown teardown_acceptance_test end def test_should_stub_expectations_instance_method instance = Class.new do def expectations :original_return_value end end.new test_result = run_as_test do instance.stubs(:expectations).returns(:stubbed_return_value) assert_equal :stubbed_return_value, instance.expectations end assert_passed(test_result) end def test_should_stub_expectations_class_method klass = Class.new do def self.expectations :original_return_value end end test_result = run_as_test do klass.stubs(:expectations).returns(:stubbed_return_value) assert_equal :stubbed_return_value, klass.expectations end assert_passed(test_result) end def test_should_stub_expectations_any_instance_method klass = Class.new do def expectations :original_return_value end end instance = klass.new test_result = run_as_test do klass.any_instance.stubs(:expectations).returns(:stubbed_return_value) assert_equal :stubbed_return_value, instance.expectations end assert_passed(test_result) end end
Version data entries
46 entries across 38 versions & 4 rubygems