module AE::Must

Must

"It is not enough to succeed. Others must fail."
                        --Gore Vidal (1925 - )

@note THIS IS AN OPTIONAL LIBRARY.

Public Instance Methods

must(*args, &block) click to toggle source

The must method is functionaly the same as should.

@example

4.must == 3  #=> Assertion Error

@example

4.must do
  self == 4
end

@return [Assertor] Assertion functor.

# File lib/ae/must.rb, line 22
def must(*args, &block)
  Assertor.new(self, :backtrace=>caller).be(*args, &block)
end
must!(*args, &block) click to toggle source

Designate a negated expectation via a functor. Read this as “must not”.

@example

4.must! == 4  #=> Assertion Error

@return [Assertor] Assertion functor.

# File lib/ae/must.rb, line 40
def must!(*args, &block)
  Assertor.new(self, :backtrace=>caller).not.be(*args, &block)
end
Also aliased as: wont, must_not, mustnt
must=(cmp) click to toggle source

Same as ‘object.must == other’.

@return [Assertor] Assertion functor.

# File lib/ae/must.rb, line 29
def must=(cmp)
  Assertor.new(self, :backtrace=>caller) == cmp
end
must_not(*args, &block)

Alias for must! method.

Alias for: must!
mustnt(*args, &block)

Alias for must! method.

Alias for: must!
wont(*args, &block)

Perhaps not literally the counter-term to must (rather will), but close enough for our purposes, and conveys the appropriate semantics.

Alias for: must!