class Object

Public Class Methods

failure_message(&block) click to toggle source
# File lib/full_table_scan_matchers/matchers/full_table_scan.rb, line 11
def self.failure_message(&block)
  failure_message_for_should(&block)
end
failure_message_when_negated(&block) click to toggle source
# File lib/full_table_scan_matchers/matchers/full_table_scan.rb, line 7
def self.failure_message_when_negated(&block)
  failure_message_for_should_not(&block)
end

Public Instance Methods

output_offenders() click to toggle source
# File lib/full_table_scan_matchers/matchers/full_table_scan.rb, line 54
def output_offenders
  @watcher.log.map(&:to_s).join("\n")
end
pluralize(count, singular, plural = nil) click to toggle source

Taken from ActionView::Helpers::TextHelper

# File lib/full_table_scan_matchers/matchers/full_table_scan.rb, line 23
def pluralize(count, singular, plural = nil)
  word = if count == 1 || count =~ /^1(\.0+)?$/
           singular
         else
           plural || singular.pluralize
         end

  "#{count || 0} #{word}"
end
replay_logged_with_explain!() click to toggle source
# File lib/full_table_scan_matchers/matchers/full_table_scan.rb, line 48
def replay_logged_with_explain!
  @watcher.log
    .map!    { |logged| FullTableScanMatchers.configuration.adapter::ExplainResult.new(logged[:sql], backtrace: logged[:backtrace], tables: @tables) }
    .reject! { |logged| !logged.full_table_scan? }
end
supports_block_expectations?() click to toggle source
# File lib/full_table_scan_matchers/matchers/full_table_scan.rb, line 15
def supports_block_expectations?
  true
end