Sha256: cc5b87458fafffff3cc9d6e17d4bce2a7cd1b62f3c5156ec1c31d74fb4d112ea
Contents?: true
Size: 1.25 KB
Versions: 46
Compression:
Stored size: 1.25 KB
Contents
require "spec_helper" include Liquidscript describe ICR::Set do its(:metadata) { should be_a Hash } describe "#to_a" do specify { expect(subject.to_a).to be_an Array } specify { expect(subject.to_a).to have(1).item } context "with metadata" do subject do set = ICR::Set.new set.metadata.merge! :hello => "world" set end specify { expect(subject.to_a).to have(2).items } specify { expect(subject.to_a).to eq [:exec, [:_hello, "world"]] } end context "with codes" do subject do set = ICR::Set.new set << "test" set end specify { expect(subject.to_a).to have(2).item } specify { expect(subject.to_a).to eq [:exec, "test"] } end context "with both" do subject do set = ICR::Set.new set.metadata.merge! :hello => "world" set << "test" set end specify { expect(subject.to_a).to have(3).items } specify { expect(subject.to_a).to eq [:exec, [:_hello, "world"], "test"] } end end describe "#add" do it "adds a code to the set" do subject.add(:number, "32") expect(subject.to_a).to have(2).items expect(subject.to_a.last).to be_a ICR::Code end end end
Version data entries
46 entries across 46 versions & 1 rubygems