Sha256: c8b9b2189be18b6f031b97dc92759f6f187b3155fed4947c978a1a1f9e9a87c3

Contents?: true

Size: 712 Bytes

Versions: 11

Compression:

Stored size: 712 Bytes

Contents

require './test/helper'

class GeometryDetectorTest < Test::Unit::TestCase
  should 'identify an image and extract its dimensions' do
    Paperclip::GeometryParser.stubs(:new).with("434x66,").returns(stub(:make => :correct))
    file = fixture_file("5k.png")
    factory = Paperclip::GeometryDetector.new(file)

    output = factory.make

    assert_equal :correct, output
  end

  should 'identify an image and extract its dimensions and orientation' do
    Paperclip::GeometryParser.stubs(:new).with("300x200,6").returns(stub(:make => :correct))
    file = fixture_file("rotated.jpg")
    factory = Paperclip::GeometryDetector.new(file)

    output = factory.make

    assert_equal :correct, output
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
paperclip-4.1.1 test/geometry_detector_test.rb
paperclip-4.1.0 test/geometry_detector_test.rb
paperclip-3.5.4 test/geometry_detector_test.rb
paperclip-4.0.0 test/geometry_detector_test.rb
paperclip-3.5.3 test/geometry_detector_test.rb
paperclip-3.5.2 test/geometry_detector_test.rb
paperclip-3.5.1 test/geometry_detector_test.rb
paperclip-3.5.0 test/geometry_detector_test.rb
paperclip-3.4.2 test/geometry_detector_test.rb
paperclip-3.4.1 test/geometry_detector_test.rb
paperclip-3.4.0 test/geometry_detector_test.rb