method

negative_failure_message

Importance_0
1.1.4 - Show latest stable - 0 notes - Class: Spec::Matchers::Have
negative_failure_message() public

No documentation

This method has no description. You can help the RSpec community by adding new notes.

Hide source
# File lib/spec/matchers/have.rb, line 52
      def negative_failure_message
        if @relativity == :exactly
          return "expected target not to have #{@expected} #{@collection_name}, got #{@actual}"
        elsif @relativity == :at_most
          return "Isn't life confusing enough?\nInstead of having to figure out the meaning of this:\nshould_not have_at_most(\#{@expected}).\#{@collection_name}\nWe recommend that you use this instead:\nshould have_at_least(\#{@expected + 1}).\#{@collection_name}\n"
        elsif @relativity == :at_least
          return "Isn't life confusing enough?\nInstead of having to figure out the meaning of this:\nshould_not have_at_least(\#{@expected}).\#{@collection_name}\nWe recommend that you use this instead:\nshould have_at_most(\#{@expected - 1}).\#{@collection_name}\n"
        end
      end
Register or log in to add new notes.