class RSpec::Raml::Matchers::MatchRaml

Public Instance Methods

description() click to toggle source
# File lib/rspec/raml/matchers/match_raml.rb, line 9
def description
  'match RAML'
end

Private Instance Methods

failure() click to toggle source
# File lib/rspec/raml/matchers/match_raml.rb, line 19
def failure
  @failure ||= matchers.find { |m| !m.matches?(response) }
end
matchers() click to toggle source
# File lib/rspec/raml/matchers/match_raml.rb, line 23
def matchers
  @matchers ||= (RSpec::Raml::Matchers::MATCHERS - [self.class]).map do |matcher|
    matcher.new(raml, verb, url, status)
  end
end
matches_raml?() click to toggle source
# File lib/rspec/raml/matchers/match_raml.rb, line 15
def matches_raml?
  failure.nil?
end
method_missing(meth, *args, &block) click to toggle source
Calls superclass method
# File lib/rspec/raml/matchers/match_raml.rb, line 33
def method_missing(meth, *args, &block)
  valid = matchers.any? do |matcher|
    if matcher.respond_to?(meth)
      matcher.send(meth, *args, &block)
      true
    end
  end

  valid ? self : super
end
respond_to_missing?(meth, *) click to toggle source
Calls superclass method
# File lib/rspec/raml/matchers/match_raml.rb, line 29
def respond_to_missing?(meth, *)
  matchers.any? { |m| m.respond_to?(meth) } || super
end