Sha256: f4219d6e596bedc1e181a3e6ffc145b60cbff786f1d09d6f86ee05f3eb6c82ce
Contents?: true
Size: 1.03 KB
Versions: 6
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' describe Neutral::Icons::Collection do let(:collection) { Neutral::Icons::Collection.new } let(:set) { Neutral::Icons::Set.new(:my_test_icons) } describe "#add" do context "when given set already exists" do let(:set) { Neutral::Icons::Set.new(:thumbs) } it "raises AlreadyDefinedIconSet error" do expect { collection.add(set.name, set.definitions) }.to raise_error end end context "when given set does not exist yet" do it "defines method on icons object with given set name and definitions" do collection.should_receive(:define!).with(set.name, set.definitions) collection.add(set) end end end describe "#define!" do before do collection.send(:define!, set.name, set.definitions) end subject { collection.send(set.name) } it { should be_a(Neutral::Icons::Collection::Definitions) } [:positive, :negative, :remove].each do |definition| its(definition) { should == set.definitions[definition] } end end end
Version data entries
6 entries across 6 versions & 1 rubygems