module BaconExpect::Matcher::BaconContext
Public Instance Methods
be(value)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 25 def be(value) Be.new(value) end
Also aliased as: equal
be_false()
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 12 def be_false BeFalse.new end
be_nil()
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 4 def be_nil BeNil.new end
be_true()
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 8 def be_true BeTrue.new end
be_within(range)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 71 def be_within(range) BeWithin.new(range) end
change(&change_block)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 67 def change(&change_block) Change.new(change_block) end
end_with(substring)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 63 def end_with(substring) EndWith.new(substring) end
eq(value)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 30 def eq(value) Eq.new(value) end
eql(value)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 21 def eql(value) Eql.new(value) end
have(number)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 47 def have(number) HaveItems.new(number) end
include(*values)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 43 def include(*values) Include.new(*values) end
match(regex)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 34 def match(regex) Match.new(regex) end
match_array(array)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 38 def match_array(array) MatchArray.new(array) end
Also aliased as: contain_exactly
method_missing(method_name, *args, &block)
click to toggle source
Calls superclass method
# File lib/bacon-expect/matchers/matchers.rb, line 75 def method_missing(method_name, *args, &block) string_method_name = method_name.to_s match_be = string_method_name.match(/^be_(.*)/) if match_be BeGeneric.new(match_be[1], *args) else match_have = string_method_name.match(/^have_(.*)/) if match_have HaveGeneric.new(match_have[1], *args) else super end end end
raise_error(exception_class = Exception, message = "")
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 16 def raise_error(exception_class = Exception, message = "") RaiseError.new(exception_class, message) end
Also aliased as: raise_exception
respond_to(method_name)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 55 def respond_to(method_name) RespondTo.new(method_name) end
satisfy(&block)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 51 def satisfy(&block) Satisfy.new(&block) end
start_with(substring)
click to toggle source
# File lib/bacon-expect/matchers/matchers.rb, line 59 def start_with(substring) StartWith.new(substring) end