test/integration/test_instance_method.rb in spy-1.0.0 vs test/integration/test_instance_method.rb in spy-1.0.1
- old
+ new
@@ -15,9 +15,15 @@
def teardown
Spy::Agency.instance.dissolve!
end
+ def test_call_through_with_instance_method
+ Spy.on_instance_method(Foo, :bar).and_call_through
+ assert_equal "foobar", Foo.new.bar
+ Spy.off_instance_method(Foo, :bar)
+ end
+
def test_it_overides_all_methods
assert_equal Foo.new.bar, "foobar"
spy = Spy.on_instance_method(Foo, bar: "timshel")
assert_equal spy, Spy::Subroutine.get(Foo, :bar, false)
assert_equal "timshel", Foo.new.bar