Class: SchemaExpectations::RSpecMatchers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/schema_expectations/rspec_matchers/base.rb

Instance Method Summary collapse

Instance Method Details

#except(*args) ⇒ Object

Specifies a list of columns for matcher to ignore

Returns:

  • self



21
22
23
24
25
26
# File 'lib/schema_expectations/rspec_matchers/base.rb', line 21

def except(*args)
  fail 'cannot use only and except' if @only
  @except = Array(args)
  fail 'empty except list' if @except.empty?
  self
end

#only(*args) ⇒ Object

Specifies a list of columns to restrict matcher

Returns:

  • self



11
12
13
14
15
16
# File 'lib/schema_expectations/rspec_matchers/base.rb', line 11

def only(*args)
  fail 'cannot use only and except' if @except
  @only = Array(args)
  fail 'empty only list' if @only.empty?
  self
end