Flowdock
method

matches?

Importance_0
1.1.12 - Show latest stable - 0 notes - Class: Spec::Matchers::SmartMatch
matches?(actual) public

No documentation

This method has no description. You can help the RSpec community by adding new notes.

Hide source
# File features/support/matchers/smart_match.rb, line 8
      def matches?(actual)
        @actual = actual
        # Satisfy expectation here. Return false or raise an error if it's not met.

        if @expected =~ /^\/.*\/?$/ || @expected =~ /^".*"$/
          regex_or_string = eval(@expected)
          if Regexp === regex_or_string
            (@actual =~ regex_or_string) ? true : false
          else
            @actual.index(regex_or_string) != nil
          end
        else
          false
        end
      end
Register or log in to add new notes.