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

- (BeIdenticalTo) initialize(expected)

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

- (Object) description



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

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

- (Object) failure_message



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

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

- (Boolean) matches?(actual)

Returns:

  • (Boolean)


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

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

- (Object) negative_failure_message



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

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