Module: CarrierWave::Test::Matchers

Defined in:
lib/carrierwave/test/matchers.rb

Overview

These are some matchers that can be used in RSpec specs, to simplify the testing of uploaders.

Defined Under Namespace

Classes: BeIdenticalTo, BeNoLargerThan, HaveDimensions, HavePermissions

Instance Method Summary collapse

Instance Method Details

#be_identical_to(expected) ⇒ Object



28
29
30
# File 'lib/carrierwave/test/matchers.rb', line 28

def be_identical_to(expected)
  BeIdenticalTo.new(expected)
end

#be_no_larger_than(width, height) ⇒ Object



79
80
81
82
# File 'lib/carrierwave/test/matchers.rb', line 79

def be_no_larger_than(width, height)
  load_rmagick
  BeNoLargerThan.new(width, height)
end

#have_dimensions(width, height) ⇒ Object



107
108
109
110
# File 'lib/carrierwave/test/matchers.rb', line 107

def have_dimensions(width, height)
  load_rmagick
  HaveDimensions.new(width, height)
end

#have_permissions(expected) ⇒ Object



52
53
54
# File 'lib/carrierwave/test/matchers.rb', line 52

def have_permissions(expected)
  HavePermissions.new(expected)
end