Class: Crspec::Matchers::BaseMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/crspec/matchers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expected = nil) ⇒ BaseMatcher

Returns a new instance of BaseMatcher.



8
9
10
# File 'lib/crspec/matchers.rb', line 8

def initialize(expected = nil)
  @expected = expected
end

Instance Attribute Details

#actualObject (readonly)

Returns the value of attribute actual.



6
7
8
# File 'lib/crspec/matchers.rb', line 6

def actual
  @actual
end

#expectedObject (readonly)

Returns the value of attribute expected.



6
7
8
# File 'lib/crspec/matchers.rb', line 6

def expected
  @expected
end

Instance Method Details

#failure_messageObject



12
13
14
# File 'lib/crspec/matchers.rb', line 12

def failure_message
  "Expected #{@actual.inspect} to match #{@expected.inspect}"
end

#failure_message_when_negatedObject



16
17
18
# File 'lib/crspec/matchers.rb', line 16

def failure_message_when_negated
  "Expected #{@actual.inspect} not to match #{@expected.inspect}"
end