Skip to content

Commit fbc0722

Browse files
committed
Small tidy up to specs.
1 parent f6cb41b commit fbc0722

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

spec/ruby/core/range/clone_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33
describe "Range#clone" do
44
it "duplicates the range" do
5-
copy = (1..3).clone
5+
original = (1..3)
6+
copy = original.clone
67
copy.begin.should == 1
78
copy.end.should == 3
89
copy.should_not.exclude_end?
10+
copy.object_id.should_not == original.object_id
911

10-
copy = ("a"..."z").clone
12+
original = ("a"..."z")
13+
copy = original.clone
1114
copy.begin.should == "a"
1215
copy.end.should == "z"
1316
copy.should.exclude_end?
17+
copy.object_id.should_not == original.object_id
1418
end
1519

1620
it "maintains the frozen state" do

spec/ruby/language/range_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
2.times do
1616
ary.push(1..3)
1717
end
18-
ary[0].object_id.should == ary[1].object_id
18+
ary[0].should.equal?(ary[1])
1919
end
2020

2121
it "creates endless ranges" do

0 commit comments

Comments
 (0)