Class Spec::Matchers::Match

  1. lib/spec/matchers/match.rb
Parent: Object

Public class methods

new (expected)
[show source]
# File lib/spec/matchers/match.rb, line 4
      def initialize(expected)
        @expected = expected
      end

Public instance methods

description ()
[show source]
# File lib/spec/matchers/match.rb, line 21
      def description
        "match #{@expected.inspect}"
      end
failure_message_for_should ()
[show source]
# File lib/spec/matchers/match.rb, line 13
      def failure_message_for_should
        return "expected #{@actual.inspect} to match #{@expected.inspect}", @expected, @actual
      end
failure_message_for_should_not ()
[show source]
# File lib/spec/matchers/match.rb, line 17
      def failure_message_for_should_not
        return "expected #{@actual.inspect} not to match #{@expected.inspect}", @expected, @actual
      end
matches? (actual)
[show source]
# File lib/spec/matchers/match.rb, line 8
      def matches?(actual)
        @actual = actual
        actual =~ @expected
      end