Sha256: f6d2bc837cf28072b56f89d09ef8c6315dcb4038e01a89d9b9f25d4b492f8b78

Contents?: true

Size: 925 Bytes

Versions: 27

Compression:

Stored size: 925 Bytes

Contents

require 'spec/matchers/have'

module Spec #:nodoc:
  module Matchers #:nodoc:
    class Have #:nodoc:
      alias_method :__original_failure_message, :failure_message
      def failure_message
        return "expected #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}, got #{@given}" if @collection_name == :errors_on
        return "expected #{relativities[@relativity]}#{@expected} error on :#{@args[0]}, got #{@given}" if @collection_name == :error_on
        return __original_failure_message
      end
      
      alias_method :__original_description, :description
      def description
        return "should have #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}" if @collection_name == :errors_on
        return "should have #{relativities[@relativity]}#{@expected} error on :#{@args[0]}" if @collection_name == :error_on
        return __original_description
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
dchelimsky-rspec-rails-1.1.10 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.11.1 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.11.2 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.11.3 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.11.4 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.11.5 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.11.6 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.11.7 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.11 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.12 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.9 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.99.1 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.99.2 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.99.3 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.99.4 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.99.5 lib/spec/rails/extensions/spec/matchers/have.rb
rspec-rails-1.1.11 lib/spec/rails/extensions/spec/matchers/have.rb
rspec-rails-1.1.10 lib/spec/rails/extensions/spec/matchers/have.rb
rspec-rails-1.1.9 lib/spec/rails/extensions/spec/matchers/have.rb
rspec-rails-1.1.12 lib/spec/rails/extensions/spec/matchers/have.rb