Skip to content

Commit c08d7b3

Browse files
committed
Remove spec which leaks a new global constant (DifferentMockObject)
* It's redundant with the spec above.
1 parent 529b1ea commit c08d7b3

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

spec/ruby/core/integer/try_convert_spec.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@
4141
}.should raise_error(TypeError, "can't convert MockObject to Integer (MockObject#to_int gives String)")
4242
end
4343

44-
it "responds with a different error message when it raises a TypeError, depending on the type of the argument object :to_int was called on " do
45-
class DifferentMockObject
46-
def to_int
47-
Object.new
48-
end
49-
end
50-
-> {
51-
Integer.try_convert DifferentMockObject.new
52-
}.should raise_error(TypeError, "can't convert DifferentMockObject to Integer (DifferentMockObject#to_int gives Object)")
53-
end
54-
5544
it "does not rescue exceptions raised by #to_int" do
5645
obj = mock("to_int")
5746
obj.should_receive(:to_int).and_raise(RuntimeError)

0 commit comments

Comments
 (0)