module AE::Should

Should

"Always and never are two words you should always
 remember never to use."
                           --Wendell Johnson

@note THIS IS AN OPTIONAL LIBRARY.

Public Instance Methods

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

Make an assertion in subjunctive tense.

4.should == 3  #=> Assertion Error

4.should do
  self == 4
end

@return [Assertor] Assertion functor.

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

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

4.should! = 4  #=> Assertion Error

@return [Assertor] Assertion functor.

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

Same as 'object.should == other'.

@return [Assertor] Assertion functor.

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

Alias for should! method.

Alias for: should!
shouldnt(*args, &block)

Alias for should! method.

Alias for: should!