summaryrefslogtreecommitdiff
path: root/spec/ruby/core/range/equal_value_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/range/equal_value_spec.rb')
-rw-r--r--spec/ruby/core/range/equal_value_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/ruby/core/range/equal_value_spec.rb b/spec/ruby/core/range/equal_value_spec.rb
new file mode 100644
index 0000000000..83dcf5cec8
--- /dev/null
+++ b/spec/ruby/core/range/equal_value_spec.rb
@@ -0,0 +1,18 @@
+require_relative '../../spec_helper'
+require_relative 'shared/equal_value'
+
+describe "Range#==" do
+ it_behaves_like :range_eql, :==
+
+ it "returns true if the endpoints are ==" do
+ (0..1).should == (0..1.0)
+ end
+
+ it "returns true if the endpoints are == for endless ranges" do
+ eval("(1.0..)").should == eval("(1.0..)")
+ end
+
+ it "returns true if the endpoints are == for beginless ranges" do
+ (...10).should == (...10)
+ end
+end