Sha256: 3ddc263409d4db0669cc3f5a657d09cfe70391cf75e75911fb19e25c5d959dcf
Contents?: true
Size: 937 Bytes
Versions: 14
Compression:
Stored size: 937 Bytes
Contents
require "spec_helper" describe Paperclip::AttachmentRegistry do context "for" do before do class AdapterTest def initialize(_target, _ = {}); end end @subject = Paperclip::AdapterRegistry.new @subject.register(AdapterTest) { |t| Symbol === t } end it "returns the class registered for the adapted type" do assert_equal AdapterTest, @subject.for(:target).class end end context "registered?" do before do class AdapterTest def initialize(_target, _ = {}); end end @subject = Paperclip::AdapterRegistry.new @subject.register(AdapterTest) { |t| Symbol === t } end it "returns true when the class of this adapter has been registered" do assert @subject.registered?(AdapterTest.new(:target)) end it "returns false when the adapter has not been registered" do assert !@subject.registered?(Object) end end end
Version data entries
14 entries across 14 versions & 1 rubygems