From 6e1a4dea0cc11c5375421a6451e83e4aa4940dab Mon Sep 17 00:00:00 2001 From: Andrew Konchin Date: Sun, 15 Oct 2017 21:57:41 +0300 Subject: [PATCH] Add spec for `IPAddr#==` bug --- library/ipaddr/operator_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/ipaddr/operator_spec.rb b/library/ipaddr/operator_spec.rb index 3f54efd486..2647b2c205 100644 --- a/library/ipaddr/operator_spec.rb +++ b/library/ipaddr/operator_spec.rb @@ -57,6 +57,13 @@ @a.should_not == IPAddr.new("3ffe:505:3::") end + ruby_version_is '2.4' do + # https://bugs.ruby-lang.org/issues/12799 + it "tests for equality correctly if object cannot be converted to IPAddr" do + IPAddr.new("1.1.1.1").should_not == "sometext" + end + end + it "sets a mask" do a = @a.mask(32) a.to_s.should == "3ffe:505::"