Parent

Templater::Spec::Helpers::InvokeMatcher

Public Class Methods

new(expected) click to toggle source
   # File lib/templater/spec/helpers.rb, line 6
6:         def initialize(expected)
7:           @expected = expected
8:         end

Public Instance Methods

failure_message() click to toggle source
    # File lib/templater/spec/helpers.rb, line 28
28:         def failure_message
29:           "expected #{@actual.inspect} to invoke #{@expected.inspect} with #{@with}, but it didn't"
30:         end
matches?(actual) click to toggle source
    # File lib/templater/spec/helpers.rb, line 10
10:         def matches?(actual)
11:           @actual = actual
12:           # Satisfy expectation here. Return false or raise an error if it's not met.
13:           found = nil
14:           @actual.invocations.each { |i| found = i if i.class == @expected }
15: 
16:           if @with
17:             return found && (@with == found.arguments)
18:           else
19:             return found
20:           end
21:         end
negative_failure_message() click to toggle source
    # File lib/templater/spec/helpers.rb, line 32
32:         def negative_failure_message
33:           "expected #{@actual.inspect} not to invoke #{@expected.inspect} with #{@with}, but it did"
34:         end
with(*arguments) click to toggle source
    # File lib/templater/spec/helpers.rb, line 23
23:         def with(*arguments)
24:           @with = arguments
25:           return self
26:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.