Sha256: 14474ba4df742af121381d759fd216945ced4a2aa65e85671b4deee231614774

Contents?: true

Size: 790 Bytes

Versions: 14

Compression:

Stored size: 790 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

module Bullet
  module Registry
    describe Association do
      subject { Association.new.tap { |association| association.add(%w[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(%w[value]))).to eq(%w[key1 key2])
        end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bullet-7.0.7 spec/bullet/registry/association_spec.rb
bullet-7.0.6 spec/bullet/registry/association_spec.rb
bullet-7.0.5 spec/bullet/registry/association_spec.rb
bullet-7.0.4 spec/bullet/registry/association_spec.rb
bullet-7.0.3 spec/bullet/registry/association_spec.rb
bullet-7.0.2 spec/bullet/registry/association_spec.rb
bullet-7.0.1 spec/bullet/registry/association_spec.rb
bullet-7.0.0 spec/bullet/registry/association_spec.rb
bullet-6.1.5 spec/bullet/registry/association_spec.rb
bullet-6.1.4 spec/bullet/registry/association_spec.rb
bullet-6.1.3 spec/bullet/registry/association_spec.rb
bullet-6.1.2 spec/bullet/registry/association_spec.rb
bullet-6.1.1 spec/bullet/registry/association_spec.rb
bullet-6.1.0 spec/bullet/registry/association_spec.rb