Module: AE::Must
- Included in:
- Object
- Defined in:
- lib/ae/must.rb
Overview
Must
"It is not enough to succeed. Others must fail."
--Gore Vidal (1925 - )
THIS IS AN OPTIONAL LIBRARY.
Instance Method Summary collapse
-
#must(*args, &block) ⇒ Object
The #must method is functionaly the same as #should.
-
#must!(*args, &block) ⇒ Object
(also: #wont)
Designate a negated expectation via a functor.
Instance Method Details
#must(*args, &block) ⇒ Object
The #must method is functionaly the same as #should.
4.must == 3 #=> Assertion Error
4.must do
self == 4
end
21 22 23 |
# File 'lib/ae/must.rb', line 21 def must(*args, &block) Assertor.new(self, :backtrace=>caller).be(*args, &block) end |
#must!(*args, &block) ⇒ Object Also known as: wont
Designate a negated expectation via a functor. Read this as “must not”.
4.must! == 4 #=> Assertion Error
30 31 32 |
# File 'lib/ae/must.rb', line 30 def must!(*args, &block) Assertor.new(self, :backtrace=>caller).not.be(*args, &block) end |