Module: RSpec::Rails::Matchers::HaveExtensions

Extended by:
ActiveSupport::Concern
Defined in:
lib/rspec/rails/matchers/have_extension.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) description_with_errors_on_extensions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Enhances the description for should have(n) matchers



21
22
23
24
25
# File 'lib/rspec/rails/matchers/have_extension.rb', line 21

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

- (Object) failure_message_for_should_with_errors_on_extensions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Enhances the failure message for should have(n) matchers



12
13
14
15
16
# File 'lib/rspec/rails/matchers/have_extension.rb', line 12

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