module MotionSpec::ContextHelper::Matchers
Public Instance Methods
be(value)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 30 def be(value) MotionSpec::Matcher::Be.new(value) end
Also aliased as: equal
be_a(test_class)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 4 def be_a(test_class) MotionSpec::Matcher::BeA.new(test_class) end
Also aliased as: be_an
be_false()
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 17 def be_false MotionSpec::Matcher::BeFalse.new end
be_nil()
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 9 def be_nil MotionSpec::Matcher::BeNil.new end
be_true()
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 13 def be_true MotionSpec::Matcher::BeTrue.new end
be_within(range)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 76 def be_within(range) MotionSpec::Matcher::BeWithin.new(range) end
change(&change_block)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 72 def change(&change_block) MotionSpec::Matcher::Change.new(change_block) end
end_with(substring)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 68 def end_with(substring) MotionSpec::Matcher::EndWith.new(substring) end
eq(value)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 35 def eq(value) MotionSpec::Matcher::Eq.new(value) end
eql(value)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 26 def eql(value) MotionSpec::Matcher::Eql.new(value) end
have(number)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 52 def have(number) MotionSpec::Matcher::HaveItems.new(number) end
include(*values)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 48 def include(*values) MotionSpec::Matcher::Include.new(*values) end
match(regex)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 39 def match(regex) MotionSpec::Matcher::Match.new(regex) end
match_array(array)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 43 def match_array(array) MotionSpec::Matcher::MatchArray.new(array) end
Also aliased as: contain_exactly
method_missing(method_name, *args, &block)
click to toggle source
Calls superclass method
# File lib/motion-spec/context_helper/matchers.rb, line 80 def method_missing(method_name, *args, &block) string_method_name = method_name.to_s match_be = string_method_name.match(/^be_(.*)/) if match_be return MotionSpec::Matcher::BeGeneric.new(match_be[1], *args) end match_have = string_method_name.match(/^have_(.*)/) if match_have return MotionSpec::Matcher::HaveGeneric.new(match_have[1], *args) end super # raise "method name not found #{method_name}" end
raise_error(exception_class = Exception, message = '')
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 21 def raise_error(exception_class = Exception, message = '') MotionSpec::Matcher::RaiseError.new(exception_class, message) end
Also aliased as: raise_exception
respond_to(method_name)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 60 def respond_to(method_name) MotionSpec::Matcher::RespondTo.new(method_name) end
satisfy(&block)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 56 def satisfy(&block) MotionSpec::Matcher::Satisfy.new(&block) end
start_with(substring)
click to toggle source
# File lib/motion-spec/context_helper/matchers.rb, line 64 def start_with(substring) MotionSpec::Matcher::StartWith.new(substring) end