Sha256: e66e504fc56d6959238775b950afd6076a1aaf66d65eb6cc7ecc6eeb04793b09

Contents?: true

Size: 839 Bytes

Versions: 15

Compression:

Stored size: 839 Bytes

Contents

require './test/helper'

class AttachmentOptionsTest < Test::Unit::TestCase
  should "be a Hash" do
    assert_kind_of Hash, Paperclip::AttachmentOptions.new({})
  end

  should "respond to []" do
    assert Paperclip::AttachmentOptions.new({}).respond_to?(:[])
  end

  should "deliver the specified options through []" do
    intended_options = {:specific_key => "specific value"}
    attachment_options = Paperclip::AttachmentOptions.new(intended_options)
    assert_equal "specific value", attachment_options[:specific_key]
  end

  should "respond to []=" do
    assert Paperclip::AttachmentOptions.new({}).respond_to?(:[]=)
  end

  should "remember options set with []=" do
    attachment_options = Paperclip::AttachmentOptions.new({})
    attachment_options[:foo] = "bar"
    assert_equal "bar", attachment_options[:foo]
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
paperclip-3.4.2 test/attachment_options_test.rb
paperclip-3.4.1 test/attachment_options_test.rb
paperclip-3.4.0 test/attachment_options_test.rb
paperclip-3.3.1 test/attachment_options_test.rb
paperclip-3.2.1 test/attachment_options_test.rb
paperclip-3.3.0 test/attachment_options_test.rb
paperclip-3.2.0 test/attachment_options_test.rb
paperclip-3.1.4 test/attachment_options_test.rb
paperclip-3.1.2 test/attachment_options_test.rb
paperclip-3.1.1 test/attachment_options_test.rb
paperclip-3.1.0 test/attachment_options_test.rb
paperclip-3.0.4 test/attachment_options_test.rb
paperclip-3.0.3 test/attachment_options_test.rb
cloudfuji_paperclip-3.0.3 test/attachment_options_test.rb
paperclip-3.0.2 test/attachment_options_test.rb