File: merge_initializer_spec.rb

package info (click to toggle)
ruby-hashie 2.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 272 kB
  • ctags: 179
  • sloc: ruby: 1,898; makefile: 4
file content (20 lines) | stat: -rw-r--r-- 548 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'spec_helper'

describe Hashie::Extensions::MergeInitializer do
  class MergeInitializerHash < Hash; include Hashie::Extensions::MergeInitializer end
  subject{ MergeInitializerHash }

  it 'should initialize fine with no arguments' do
    subject.new.should == {}
  end

  it 'should initialize with a hash' do
    subject.new(:abc => 'def').should == {:abc => 'def'}
  end

  it 'should initialize with a hash and a default' do
    h = subject.new({:abc => 'def'}, 'bar')
    h[:foo].should == 'bar'
    h[:abc].should == 'def'
  end
end