Sha256: 5067502ca7b42f72b8b8c067ded8e0fccf31851bce6bd5b126376d4424183d93

Contents?: true

Size: 752 Bytes

Versions: 18

Compression:

Stored size: 752 Bytes

Contents

require 'spec_helper'

module Bullet
  module Registry
    describe Association do
      subject { Association.new.tap { |association| association.add(["key1", "key2"], "value") } }

      context "#merge" do
        it "should merge key/value" do
          subject.merge("key0", "value0")
          subject["key0"].should be_include("value0")
        end
      end

      context "#similarly_associated" do
        it "should return similarly associated keys" do
          subject.similarly_associated("key1", Set.new(["value"])).should == ["key1", "key2"]
        end

        it "should return empty if key does not exist" do
          subject.similarly_associated("key3", Set.new(["value"])).should be_empty
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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