summaryrefslogtreecommitdiff
path: root/spec/ruby/core/comparable/equal_value_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/comparable/equal_value_spec.rb')
-rw-r--r--spec/ruby/core/comparable/equal_value_spec.rb41
1 files changed, 8 insertions, 33 deletions
diff --git a/spec/ruby/core/comparable/equal_value_spec.rb b/spec/ruby/core/comparable/equal_value_spec.rb
index 24d9fec2fb..3af40d1c7e 100644
--- a/spec/ruby/core/comparable/equal_value_spec.rb
+++ b/spec/ruby/core/comparable/equal_value_spec.rb
@@ -39,7 +39,7 @@ describe "Comparable#==" do
end
it "returns false" do
- (a == b).should be_false
+ (a == b).should == false
end
end
@@ -48,16 +48,8 @@ describe "Comparable#==" do
a.should_receive(:<=>).once.and_return("abc")
end
- ruby_version_is ""..."2.3" do
- it "returns false" do
- (a == b).should be_false
- end
- end
-
- ruby_version_is "2.3" do
- it "raises an ArgumentError" do
- lambda { (a == b) }.should raise_error(ArgumentError)
- end
+ it "raises an ArgumentError" do
+ -> { (a == b) }.should.raise(ArgumentError)
end
end
@@ -67,17 +59,8 @@ describe "Comparable#==" do
a.should_receive(:<=>).once.and_raise(StandardError)
end
- ruby_version_is ""..."2.3" do
- # Behaviour confirmed by MRI test suite
- it "returns false" do
- (a == b).should be_false
- end
- end
-
- ruby_version_is "2.3" do
- it "lets it go through" do
- lambda { (a == b) }.should raise_error(StandardError)
- end
+ it "lets it go through" do
+ -> { (a == b) }.should.raise(StandardError)
end
end
@@ -87,22 +70,14 @@ describe "Comparable#==" do
a.should_receive(:<=>).once.and_raise(TypeError)
end
- ruby_version_is ""..."2.3" do
- it "returns false" do
- (a == b).should be_false
- end
- end
-
- ruby_version_is "2.3" do
- it "lets it go through" do
- lambda { (a == b) }.should raise_error(TypeError)
- end
+ it "lets it go through" do
+ -> { (a == b) }.should.raise(TypeError)
end
end
it "lets it go through if it is not a StandardError" do
a.should_receive(:<=>).once.and_raise(Exception)
- lambda { (a == b) }.should raise_error(Exception)
+ -> { (a == b) }.should.raise(Exception)
end
end