Sha256: 7b0dbd4c99202b519a85cd584cc05bd174ec4e7f1d4c5eb3a628da4b8eea5823

Contents?: true

Size: 669 Bytes

Versions: 7

Compression:

Stored size: 669 Bytes

Contents

require 'spec_helper'

describe "MiniMagic" do
  with_file_model

  before :all do
    class ImageFile
      inherit FileModel

      def process &block
        mini_magic block do |image|
          image.resize '150x150'
        end
      end

      version :icon do
        def process &block
          mini_magic block do |image|
            image.resize '50x50'
          end
        end
      end
    end
  end
  after(:all){remove_constants :ImageFile}

  before do
    @file = "#{spec_dir}/bos.jpg".to_file
  end

  it "resizing" do
    image = ImageFile.new
    image.original = @file
    image.save!

    image.file.size.should > image.icon.file.size
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
file_model-0.1.0 spec/mini_magic_spec.rb
file_model-0.0.7 spec/mini_magic_spec.rb
file_model-0.0.6 spec/mini_magic_spec.rb
file_model-0.0.5 spec/mini_magic_spec.rb
file_model-0.0.4 spec/mini_magic_spec.rb
file_model-0.0.3 spec/mini_magic_spec.rb
file_model-0.0.2 spec/mini_magic_spec.rb