Sha256: edb827597fcafb21845c157f81bb595543613722b5940e2bd069a5ce22839cf2

Contents?: true

Size: 927 Bytes

Versions: 50

Compression:

Stored size: 927 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 #{@actual}" if @collection_name == :errors_on
        return "expected #{relativities[@relativity]}#{@expected} error on :#{@args[0]}, got #{@actual}" 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

50 entries across 50 versions & 10 rubygems

Version Path
dchelimsky-rspec-rails-1.1.6 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.7 lib/spec/rails/extensions/spec/matchers/have.rb
dchelimsky-rspec-rails-1.1.8 lib/spec/rails/extensions/spec/matchers/have.rb
jcnetdev-rspec-rails-1.1.5 lib/spec/rails/extensions/spec/matchers/have.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec-rails/lib/spec/rails/extensions/spec/matchers/have.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec-rails/lib/spec/rails/extensions/spec/matchers/have.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec-rails/lib/spec/rails/extensions/spec/matchers/have.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec-rails/lib/spec/rails/extensions/spec/matchers/have.rb
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
picolena-0.1.0 rails_plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
picolena-0.1.1 rails_plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb
picolena-0.1.2 rails_plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb