Sha256: f4b5b95be0432c8d5761654eb43a218cb53c764a22650e87613c257214b07657

Contents?: true

Size: 765 Bytes

Versions: 39

Compression:

Stored size: 765 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")
          expect(subject["key0"]).to be_include("value0")
        end
      end

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

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

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
bullet-4.14.5 spec/bullet/registry/association_spec.rb
bullet_instructure-4.0.5 spec/bullet/registry/association_spec.rb
bullet-4.14.4 spec/bullet/registry/association_spec.rb
bullet-4.14.3 spec/bullet/registry/association_spec.rb
bullet-4.14.2 spec/bullet/registry/association_spec.rb
bullet-4.14.0 spec/bullet/registry/association_spec.rb
bullet-4.13.2 spec/bullet/registry/association_spec.rb
bullet-4.13.1 spec/bullet/registry/association_spec.rb
bullet_instructure-4.0.3 spec/bullet/registry/association_spec.rb
bullet-4.13.0 spec/bullet/registry/association_spec.rb
bullet-4.12.0 spec/bullet/registry/association_spec.rb
bullet_instructure-4.0.2 spec/bullet/registry/association_spec.rb
bullet-4.11.3 spec/bullet/registry/association_spec.rb
bullet-4.11.2 spec/bullet/registry/association_spec.rb
bullet-4.11.1 spec/bullet/registry/association_spec.rb
bullet-4.11.0 spec/bullet/registry/association_spec.rb
bullet-4.10.0 spec/bullet/registry/association_spec.rb
bullet-4.9.0 spec/bullet/registry/association_spec.rb
bullet-4.8.0 spec/bullet/registry/association_spec.rb