module RSpec

Public Instance Methods

message(expected, counter, negation = false) click to toggle source
# File lib/rspec/sqlimit.rb, line 36
    def message(expected, counter, negation = false)
      reporter    = RSpec::SQLimit::Reporter.new(counter)
      condition   = negation ? "maximum" : "more than"
      restriction = " that match #{reporter.matcher}" if reporter.matcher

      <<-MESSAGE.gsub(/ +\|/, "")
        |Expected to run #{condition} #{expected} queries#{restriction}
        |#{reporter.call}
      MESSAGE
    end