X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/a5336e68a3fb124b6d024ea9b0b9d7bfe88b3b6a..0436b4878ce29c48b690772e61fcaf7aaae8a4ac:/vendor/gems/rspec-1.1.2/stories/resources/matchers/smart_match.rb diff --git a/vendor/gems/rspec-1.1.2/stories/resources/matchers/smart_match.rb b/vendor/gems/rspec-1.1.2/stories/resources/matchers/smart_match.rb deleted file mode 100644 index 7b1672bc0..000000000 --- a/vendor/gems/rspec-1.1.2/stories/resources/matchers/smart_match.rb +++ /dev/null @@ -1,37 +0,0 @@ -module Spec - module Matchers - class SmartMatch - def initialize(expected) - @expected = expected - end - - 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 - - def failure_message - "expected #{@actual.inspect} to smart_match #{@expected.inspect}, but it didn't" - end - - def negative_failure_message - "expected #{@actual.inspect} not to smart_match #{@expected.inspect}, but it did" - end - end - - def smart_match(expected) - SmartMatch.new(expected) - end - end -end \ No newline at end of file