Module: QED::Grammar::Should
- Defined in:
- lib/qed/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
18 19 20 |
# File 'lib/qed/grammar/should.rb', line 18 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!
29 30 31 |
# File 'lib/qed/grammar/should.rb', line 29 def should! return Expectation.new(self, :negate=>true, :backtrace=>caller) end |