Sha256: c606526bc0260d8dcd75dd356db32935d03b21d55170f9b04fc5fe2c0fd62fd4
Contents?: true
Size: 934 Bytes
Versions: 6
Compression:
Stored size: 934 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
6 entries across 6 versions & 2 rubygems