Skip to content

Commit

Permalink
Spec for Range#===, showing <=> must be used
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed Feb 12, 2010
1 parent fdf8c13 commit 9c377fe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/ruby/core/range/shared/include.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@
(0.5..2.4).send(@method, 2.4).should == true
(0.5...2.4).send(@method, 2.4).should == false
end

it "compares values using <=>" do
rng = (1..5)
m = mock("int")
m.should_receive(:coerce).and_return([1, 2])
m.should_receive(:<=>).and_return(1)

rng.send(@method, m).should be_false
end
end

0 comments on commit 9c377fe

Please sign in to comment.