File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
describe "Range#clone" do
4
4
it "duplicates the range" do
5
- copy = ( 1 ..3 ) . clone
5
+ original = ( 1 ..3 )
6
+ copy = original . clone
6
7
copy . begin . should == 1
7
8
copy . end . should == 3
8
9
copy . should_not . exclude_end?
10
+ copy . object_id . should_not == original . object_id
9
11
10
- copy = ( "a" ..."z" ) . clone
12
+ original = ( "a" ..."z" )
13
+ copy = original . clone
11
14
copy . begin . should == "a"
12
15
copy . end . should == "z"
13
16
copy . should . exclude_end?
17
+ copy . object_id . should_not == original . object_id
14
18
end
15
19
16
20
it "maintains the frozen state" do
Original file line number Diff line number Diff line change 15
15
2 . times do
16
16
ary . push ( 1 ..3 )
17
17
end
18
- ary [ 0 ] . object_id . should == ary [ 1 ] . object_id
18
+ ary [ 0 ] . should . equal? ( ary [ 1 ] )
19
19
end
20
20
21
21
it "creates endless ranges" do
You can’t perform that action at this time.
0 commit comments