Parent

Class Index [+]

Quicksearch

Spec::Matchers::SimpleMatcher

Attributes

failure_message[W]
negative_failure_message[W]
description[W]

Public Class Methods

new(description, &match_block) click to toggle source
    # File lib/spec/matchers/simple_matcher.rb, line 6
 6:       def initialize(description, &match_block)
 7:         @description = description
 8:         @match_block = match_block
 9:         @failure_message = @negative_failure_message = nil
10:       end

Public Instance Methods

description() click to toggle source
    # File lib/spec/matchers/simple_matcher.rb, line 22
22:       def description
23:         @description || explanation
24:       end
explanation() click to toggle source
    # File lib/spec/matchers/simple_matcher.rb, line 34
34:       def explanation
35:         "No description provided. See RDoc for simple_matcher()"
36:       end
failure_message_for_should() click to toggle source
    # File lib/spec/matchers/simple_matcher.rb, line 26
26:       def failure_message_for_should
27:         @failure_message || (@description.nil? ? explanation : %[expected #{@description.inspect} but got #{@given.inspect}])
28:       end
failure_message_for_should_not() click to toggle source
    # File lib/spec/matchers/simple_matcher.rb, line 30
30:       def failure_message_for_should_not
31:         @negative_failure_message || (@description.nil? ? explanation : %[expected not to get #{@description.inspect}, but got #{@given.inspect}])
32:       end
matches?(given) click to toggle source
    # File lib/spec/matchers/simple_matcher.rb, line 12
12:       def matches?(given)
13:         @given = given
14:         case @match_block.arity
15:         when 2
16:           @match_block.call(@given, self)
17:         else
18:           @match_block.call(@given)
19:         end
20:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.