Sha256: 47bae2e95b86dd1a2dbb3adc005b7b1a477e33f51445f516d382e1a9d165880b

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

module Bullet
  module Registry
    describe Base do
      subject { Base.new.tap { |base| base.add("key", "value") } }

      context "#[]" do
        it "should get value by key" do
          subject["key"].should == Set.new(["value"])
        end
      end

      context "#delete" do
        it "should delete key" do
          subject.delete("key")
          subject["key"].should be_nil
        end
      end

      context "#add" do
        it "should add value with string" do
          subject.add("key", "new_value")
          subject["key"].should == Set.new(["value", "new_value"])
        end

        it "should add value with array" do
          subject.add("key", ["value1", "value2"])
          subject["key"].should == Set.new(["value", "value1", "value2"])
        end
      end

      context "#include?" do
        it "should include key/value" do
          subject.include?("key", "value").should be_true
        end

        it "should not include wrong key/value" do
          subject.include?("key", "val").should be_false
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
bullet-4.7.1 spec/bullet/registry/base_spec.rb
bullet-4.7.0 spec/bullet/registry/base_spec.rb
bullet-4.6.0 spec/bullet/registry/base_spec.rb
bullet-4.5.0 spec/bullet/registry/base_spec.rb
bullet-4.4.0 spec/bullet/registry/base_spec.rb
bullet-4.3.1 spec/bullet/registry/base_spec.rb
bullet-4.3.0 spec/bullet/registry/base_spec.rb
bullet-4.2.0 spec/bullet/registry/base_spec.rb
bullet-4.1.6 spec/bullet/registry/base_spec.rb
bullet-4.1.5 spec/bullet/registry/base_spec.rb
bullet-4.1.4 spec/bullet/registry/base_spec.rb
bullet-4.1.3 spec/bullet/registry/base_spec.rb
bullet-4.1.2 spec/bullet/registry/base_spec.rb
bullet-4.1.1 spec/bullet/registry/base_spec.rb
bullet-4.1.0 spec/bullet/registry/base_spec.rb
bullet-4.0.0 spec/bullet/registry/base_spec.rb
bullet-2.3.1 spec/bullet/registry/base_spec.rb
bullet-2.3.0 spec/bullet/registry/base_spec.rb