module Quarry module Grammar # = Assert Nomenclature # # Some people prefer TDD over BDD so we also provide an # assertion-based nomenclature. # module Assert # Assert a operational relationship. # # 4.assert == 3 # def assert return Expectation.new(self, :backtrace=>caller) end # Assert not an operational relationship. # Read it as "assert not". # # 4.assert! == 4 # # AUHTOR'S NOTE: This method would not be necessary # if Ruby would allow +!=+ to be define as a method, # or at least +!+ as a unary method. # def assert! return Expectation.new(self, :negate=>true, :backtrace=>caller) end # Same as #assert!. # # 4.refute == 4 #=> Assertion Error # alias_method :refute, :assert! end end class ::Object #:nodoc: include Grammar::Assert end end