test/integration/test_constant_spying.rb in spy-1.0.0 vs test/integration/test_constant_spying.rb in spy-1.0.1
- old
+ new
@@ -28,28 +28,28 @@
def test_spy_on_constant
assert_equal "hello world", Foo.hello
spy = Spy.on_const(Foo, :HELLO)
- assert_equal nil, Foo.hello
+ assert_nil Foo.hello
spy.and_return("awesome")
assert_equal "awesome", Foo.hello
Spy.off_const(Foo, :HELLO)
assert_equal "hello world", Foo.hello
assert_equal "hello world", Foo::Bar.hello
spy = Spy.on_const(Foo, :HELLO)
- assert_equal nil, Foo::Bar.hello
+ assert_nil Foo::Bar.hello
spy.and_return("awesome")
assert_equal "awesome", Foo::Bar.hello
Spy.off_const(Foo, :HELLO)
assert_equal "hello world", Foo::Bar.hello
assert_equal "hello world", ChildFoo.hello
spy = Spy.on_const(Foo, :HELLO)
- assert_equal nil, ChildFoo.hello
+ assert_nil ChildFoo.hello
spy.and_return("awesome")
assert_equal "awesome", ChildFoo.hello
Spy.off_const(Foo, :HELLO)
assert_equal "hello world", ChildFoo.hello