class TOTS::Matcher

The `must` thingy

Awesome matchers handler

“`ruby describe TOTS::Matcher::Awesome do

it "must provide awesome matchers" do
  22.must == 22
  22.must >  11
  22.must =~ /2/
end

end “`

Public Class Methods

new(object, *args) click to toggle source
# File lib/tots/matcher.rb, line 7
def initialize(object, *args)
  @object = object
end

Public Instance Methods

!=(value) click to toggle source
# File lib/tots/matcher/awesome.rb, line 19
def !=(value)
  assert @object != value, "#{@object.inspect} supposed not to be equal #{value.inspect}"
end
<(value) click to toggle source
# File lib/tots/matcher/awesome.rb, line 31
def <(value)
  assert @object < value, "#{@object.inspect} supposed to be < than #{value.inspect}"
end
<=(value) click to toggle source
# File lib/tots/matcher/awesome.rb, line 39
def <=(value)
  assert @object <= value, "#{@object.inspect} supposed to be <= than #{value.inspect}"
end
==(value) click to toggle source
# File lib/tots/matcher/awesome.rb, line 15
def ==(value)
  assert @object == value, "#{@object.inspect} supposed to be equal #{value.inspect}"
end
=~(value) click to toggle source
# File lib/tots/matcher/awesome.rb, line 23
def =~(value)
  assert value =~ @object, "#{@object.inspect} doesn't match #{value.inspect}"
end
>(value) click to toggle source
# File lib/tots/matcher/awesome.rb, line 27
def >(value)
  assert @object > value, "#{@object.inspect} supposed to be > than #{value.inspect}"
end
>=(value) click to toggle source
# File lib/tots/matcher/awesome.rb, line 35
def >=(value)
  assert @object >= value, "#{@object.inspect} supposed to be >= than #{value.inspect}"
end