class RSpec::ActiveRecord::Expectations::MessageBuilder

Attributes

matcher[R]
phrase_builder[R]

Public Class Methods

new(matcher) click to toggle source
# File lib/rspec/activerecord/expectations/message_builder.rb, line 5
def initialize(matcher)
  @matcher = matcher
  @phrase_builder = case matcher
    when Matchers::QueryCountMatcher then QueryPhrases.new(matcher)
    when Matchers::TransactionMatcher then TransactionPhrases.new(matcher)
    else raise ArgumentError
  end
end

Public Instance Methods

failure_message() click to toggle source
# File lib/rspec/activerecord/expectations/message_builder.rb, line 14
def failure_message
  "expected block to #{phrase_builder.prefix}, but it #{phrase_builder.suffix}"
end
failure_message_when_negated() click to toggle source
# File lib/rspec/activerecord/expectations/message_builder.rb, line 18
def failure_message_when_negated
  "expected block not to #{phrase_builder.prefix}, but it #{phrase_builder.negative_suffix}"
end