summaryrefslogtreecommitdiff
path: root/spec/ruby/core/array/min_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/array/min_spec.rb')
-rw-r--r--spec/ruby/core/array/min_spec.rb20
1 files changed, 9 insertions, 11 deletions
diff --git a/spec/ruby/core/array/min_spec.rb b/spec/ruby/core/array/min_spec.rb
index 903fa69bb8..5913e08cf8 100644
--- a/spec/ruby/core/array/min_spec.rb
+++ b/spec/ruby/core/array/min_spec.rb
@@ -1,10 +1,8 @@
require_relative '../../spec_helper'
describe "Array#min" do
- ruby_version_is "2.4" do
- it "is defined on Array" do
- [1].method(:max).owner.should equal Array
- end
+ it "is defined on Array" do
+ [1].method(:max).owner.should.equal? Array
end
it "returns nil with no values" do
@@ -66,22 +64,22 @@ describe "Array#min" do
end
it "returns nil for an empty Enumerable" do
- [].min.should be_nil
+ [].min.should == nil
end
it "raises a NoMethodError for elements without #<=>" do
- lambda do
+ -> do
[BasicObject.new, BasicObject.new].min
- end.should raise_error(NoMethodError)
+ end.should.raise(NoMethodError)
end
it "raises an ArgumentError for incomparable elements" do
- lambda do
+ -> do
[11,"22"].min
- end.should raise_error(ArgumentError)
- lambda do
+ end.should.raise(ArgumentError)
+ -> do
[11,12,22,33].min{|a, b| nil}
- end.should raise_error(ArgumentError)
+ end.should.raise(ArgumentError)
end
it "returns the minimum when using a block rule" do