Class: CarrierWave::Test::Matchers::BeIdenticalTo

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ BeIdenticalTo

Returns a new instance of BeIdenticalTo



13
14
15
# File 'lib/carrierwave/test/matchers.rb', line 13

def initialize(expected)
  @expected = expected
end

Instance Method Details

#descriptionObject



30
31
32
# File 'lib/carrierwave/test/matchers.rb', line 30

def description
  "be identical to #{@expected.inspect}"
end

#failure_messageObject



22
23
24
# File 'lib/carrierwave/test/matchers.rb', line 22

def failure_message
  "expected #{@actual.inspect} to be identical to #{@expected.inspect}"
end

#failure_message_when_negatedObject Also known as: negative_failure_message



26
27
28
# File 'lib/carrierwave/test/matchers.rb', line 26

def failure_message_when_negated
  "expected #{@actual.inspect} to not be identical to #{@expected.inspect}"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
20
# File 'lib/carrierwave/test/matchers.rb', line 17

def matches?(actual)
  @actual = actual
  FileUtils.identical?(@actual, @expected)
end