Method: MotionSpec::ContextHelper::Matchers#method_missing

Defined in:
lib/motion-spec/context_helper/matchers.rb

#method_missing(method_name, *args, &block) ⇒ Object



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/motion-spec/context_helper/matchers.rb', line 81

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