Sha256: 530225e70f738c3860223c8268a989b6e58b8c7f2391d82811ec8a9781011b45

Contents?: true

Size: 541 Bytes

Versions: 36

Compression:

Stored size: 541 Bytes

Contents

require 'spec_helper'

describe Hashie::Extensions::MergeInitializer do
  class MergeInitializerHash < Hash
    include Hashie::Extensions::MergeInitializer
  end

  subject { MergeInitializerHash }

  it 'initializes with no arguments' do
    expect(subject.new).to eq({})
  end

  it 'initializes with a hash' do
    expect(subject.new(abc: 'def')).to eq(abc: 'def')
  end

  it 'initializes with a hash and a default' do
    h = subject.new({ abc: 'def' }, 'bar')
    expect(h[:foo]).to eq 'bar'
    expect(h[:abc]).to eq 'def'
  end
end

Version data entries

36 entries across 33 versions & 6 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/hashie-3.6.0/spec/hashie/extensions/merge_initializer_spec.rb
hashie-4.0.0 spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.6.0 spec/hashie/extensions/merge_initializer_spec.rb
tdiary-5.0.8 vendor/bundle/gems/hashie-3.5.7/spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.5.7 spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.5.6 spec/hashie/extensions/merge_initializer_spec.rb
tdiary-5.0.5 vendor/bundle/gems/hashie-3.5.5/spec/hashie/extensions/merge_initializer_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/hashie-3.5.5/spec/hashie/extensions/merge_initializer_spec.rb
tdiary-5.0.4 vendor/bundle/gems/hashie-3.5.5/spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.5.5 spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.5.4 spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.5.3 spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.5.2 spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.5.1 spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.5.0 spec/hashie/extensions/merge_initializer_spec.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/hashie-3.4.6/spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.4.6 spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.4.5 spec/hashie/extensions/merge_initializer_spec.rb
hashie-3.4.4 spec/hashie/extensions/merge_initializer_spec.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/hashie-3.4.3/spec/hashie/extensions/merge_initializer_spec.rb