Module: Quarry::Grammar::Should
- Defined in:
- lib/quarry/grammar/should.rb
Overview
Should Nomenclature
The term should has become the defacto standard for BDD assertions, so Quarry supports this nomenclature.
Instance Method Summary collapse
-
#should ⇒ Object
Same as #expect but only as a functor.
-
#should! ⇒ Object
(also: #should_not)
Designate a negated expectation via a functor.
Instance Method Details
#should ⇒ Object
Same as #expect but only as a functor.
4.should == 3 #=> Expectation Error
16 17 18 |
# File 'lib/quarry/grammar/should.rb', line 16 def should return Expectation.new(self, :backtrace=>caller) end |
#should! ⇒ Object Also known as: should_not
Designate a negated expectation via a functor. Read this as “should not”.
4.should! == 4 #=> Expectation Error
See also #expect!
27 28 29 |
# File 'lib/quarry/grammar/should.rb', line 27 def should! return Expectation.new(self, :negate=>true, :backtrace=>caller) end |