Sha256: 01b8e4924fc96cf373e51f5c4ad3bfa90cfe4724e85d86e9f92fdff75cc7010c
Contents?: true
Size: 953 Bytes
Versions: 1
Compression:
Stored size: 953 Bytes
Contents
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
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
quarry-0.5.0 | lib/quarry/grammar/assert.rb |