summaryrefslogtreecommitdiff
path: root/spec/ruby/core/range/case_compare_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/range/case_compare_spec.rb')
-rw-r--r--spec/ruby/core/range/case_compare_spec.rb20
1 files changed, 13 insertions, 7 deletions
diff --git a/spec/ruby/core/range/case_compare_spec.rb b/spec/ruby/core/range/case_compare_spec.rb
index cada3b7cd5..7a76487d68 100644
--- a/spec/ruby/core/range/case_compare_spec.rb
+++ b/spec/ruby/core/range/case_compare_spec.rb
@@ -1,11 +1,17 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/cover_and_include', __FILE__)
-require File.expand_path('../shared/cover', __FILE__)
+require_relative '../../spec_helper'
+require_relative 'shared/cover_and_include'
+require_relative 'shared/cover'
describe "Range#===" do
- it "returns the result of calling #include? on self" do
- range = 0...10
- range.should_receive(:include?).with(2).and_return(:true)
- (range === 2).should == :true
+ it "returns the result of calling #cover? on self" do
+ range = RangeSpecs::WithoutSucc.new(0)..RangeSpecs::WithoutSucc.new(10)
+ (range === RangeSpecs::WithoutSucc.new(2)).should == true
+ end
+
+ it_behaves_like :range_cover_and_include, :===
+ it_behaves_like :range_cover, :===
+
+ it "returns true on any value if begin and end are both nil" do
+ (nil..nil).should === 1
end
end