Class: Remarkable::ActiveRecord::Matchers::IndexMatcher

Inherits:
Matcher::Base
  • Object
show all
Defined in:
lib/remarkable/active_record/macros/database/index_matcher.rb

Constant Summary collapse

INDEX_TYPES =
{ true => "unique", false => "non-unique" }

Instance Method Summary collapse

Methods inherited from Matcher::Base

#negative, #spec

Methods included from Matcher::DSL

included, #matches?

Instance Method Details

#descriptionObject



25
26
27
# File 'lib/remarkable/active_record/macros/database/index_matcher.rb', line 25

def description
  "have #{index_type} index on #{table_name} for #{@columns.inspect}"
end

#failure_messageObject



17
18
19
# File 'lib/remarkable/active_record/macros/database/index_matcher.rb', line 17

def failure_message
  "Expected to #{expectation} (#{@missing})"
end

#negative_failure_messageObject



21
22
23
# File 'lib/remarkable/active_record/macros/database/index_matcher.rb', line 21

def negative_failure_message
  "Did not expect to #{expectation}"
end

#table_name=(table_name) ⇒ Object



13
14
15
# File 'lib/remarkable/active_record/macros/database/index_matcher.rb', line 13

def table_name=(table_name)
  @table_name = table_name
end