Parent

Class Index [+]

Quicksearch

Spec::Matchers::Has

Public Class Methods

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

Public Instance Methods

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

Private Instance Methods

predicate(sym) click to toggle source
    # File lib/spec/matchers/has.rb, line 28
28:       def predicate(sym)
29:         "#{sym.to_s.sub("have_","has_")}?".to_sym
30:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.