Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def <=> other
- self.id <=> other.id
- end
- ## This is the warning I get
- context "House comparison" do
- setup do
- @house1 = House.new
- @house2 = House.new
- end
- should "be identical if they have identical ids" do
- @house1.id = 1
- @house2.id = 1
- assert @house1 == @house2
- end
- should "be less than another house with a lower house id" do
- @house1.id = 1
- @house2.id = 2
- assert @house1 < @house2
- end
- should "be greater than another house with a lower house id" do
- @house1.id = 2
- @house2.id = 1
- assert @house1 > @house2
- end
- end
- ## The warning I get
- warning: Object#id will be deprecated; use Object#object_id
Add Comment
Please, Sign In to add comment