Sha256: fda81a48bc979932b1958ad930b7eecdc2e356004575b288ce4b4b5d034e7351

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

require 'active_support/core_ext/module/aliasing'
require 'rspec/matchers/have'

module RSpec #:nodoc:
  module Matchers #:nodoc:
    class Have #:nodoc:
      def failure_message_for_should_with_errors_on_extensions
        return "expected #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}, got #{@actual}" if @collection_name == :errors_on
        return "expected #{relativities[@relativity]}#{@expected} error on :#{@args[0]}, got #{@actual}"  if @collection_name == :error_on
        return failure_message_for_should_without_errors_on_extensions
      end
      alias_method_chain :failure_message_for_should, :errors_on_extensions
      
      def description_with_errors_on_extensions
        return "have #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}" if @collection_name == :errors_on
        return "have #{relativities[@relativity]}#{@expected} error on :#{@args[0]}"  if @collection_name == :error_on
        return description_without_errors_on_extensions
      end
      alias_method_chain :description, :errors_on_extensions
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rspec-rails-2.0.0.beta.17 lib/rspec/rails/matchers/have_extension.rb
rspec-rails-2.0.0.beta.16 lib/rspec/rails/matchers/have_extension.rb
rspec-rails-2.0.0.beta.15 lib/rspec/rails/matchers/have_extension.rb
rspec-rails-2.0.0.beta.14.2 lib/rspec/rails/matchers/have_extension.rb
rspec-rails-2.0.0.beta.14.1 lib/rspec/rails/matchers/have_extension.rb
rspec-rails-2.0.0.beta.13 lib/rspec/rails/matchers/have_extension.rb