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.



11
12
13
# File 'lib/carrierwave/test/matchers.rb', line 11

def initialize(expected)
  @expected = expected
end

Instance Method Details

#failure_messageObject



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

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#negative_failure_messageObject



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

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