Parent

Class/Module Index [+]

Quicksearch

Spec::Matchers::Has

Public Class Methods

new(expected, *args, &block) click to toggle source
# File lib/spec/matchers/has.rb, line 6
def initialize(expected, *args, &block)
  @expected, @args, @block = expected, args, block
end

Public Instance Methods

description() click to toggle source
# File lib/spec/matchers/has.rb, line 22
def description
  "have key #{@args[0].inspect}"
end
failure_message_for_should() click to toggle source
# File lib/spec/matchers/has.rb, line 14
def failure_message_for_should
  "expected ##{predicate(@expected)}(#{@args[0].inspect}) to return true, got false"
end
failure_message_for_should_not() click to toggle source
# File lib/spec/matchers/has.rb, line 18
def failure_message_for_should_not
  "expected ##{predicate(@expected)}(#{@args[0].inspect}) to return false, got true"
end
matches?(actual) click to toggle source
# File lib/spec/matchers/has.rb, line 10
def matches?(actual)
  actual.__send__(predicate(@expected), *@args, &@block)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.