Parent

Included Modules

Class Index [+]

Quicksearch

RSpec::Matchers::BuiltIn::StartAndEndWith

Public Class Methods

new(*expected) click to toggle source
   # File lib/rspec/matchers/built_in/start_and_end_with.rb, line 7
7:         def initialize(*expected)
8:           @expected = expected.length == 1 ? expected.first : expected
9:         end

Public Instance Methods

failure_message_for_should() click to toggle source
    # File lib/rspec/matchers/built_in/start_and_end_with.rb, line 20
20:         def failure_message_for_should
21:           "expected #{@actual.inspect} to #{self.class.name.split('::').last.sub(/With/,'').downcase} with #{@expected.inspect}"
22:         end
failure_message_for_should_not() click to toggle source
    # File lib/rspec/matchers/built_in/start_and_end_with.rb, line 24
24:         def failure_message_for_should_not
25:           "expected #{@actual.inspect} not to #{self.class.name.split('::').last.sub(/With/,'').downcase} with #{@expected.inspect}"
26:         end
matches?(actual) click to toggle source
    # File lib/rspec/matchers/built_in/start_and_end_with.rb, line 11
11:         def matches?(actual)
12:           @actual = actual.respond_to?(:[]) ? actual : (raise ArgumentError.new("#{actual.inspect} does not respond to :[]"))
13:           begin
14:             @expected.respond_to?(:length) ? subset_matches?(@expected, @actual) : element_matches?(@expected, @actual)
15:           rescue ArgumentError
16:             raise ArgumentError.new("#{actual.inspect} does not have ordered elements")
17:           end
18:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.