I have a model that uses See the following I test that comparative and I required
& lt ; = & Gt; For this method how should I go about this w /
rspec test (I know that this is not TDD because I have already applied the method)?
class grades & lt; ActiveRecord :: Base includes Comparable def & lt; = & Gt; (Other) self.sort_key & lt; = & Gt; Other. Sort_key end end
grade implementation Occurred:
class grade attr_reader: sort_key def initialize (sort_key) @sort_key = sort_key end def & lt; = & Gt; (Other) Returns blue until that other. Pamped_to? (: Sort_key) @sort_key & lt; = & Gt; Other.sort_key end end
grade # & lt; = & Gt; behaves properly, which is for
object # & lt; = & Gt; Says:
# comparable_grade.spec "Grade # & lt; = & gt; Do this while doing" When both operands are equal "(Grade. New (0) <= Grade.New (0)). "(Grade.New (0)
No comments:
Post a Comment