Skip to content

Commit

Permalink
Hash spec
Browse files Browse the repository at this point in the history
  • Loading branch information
firedev committed Oct 10, 2015
1 parent b777f6c commit ca2c44c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions spec/hash_spec.rb
@@ -0,0 +1,29 @@
require_relative '../lib/bottomless_hash'

describe Hash do
subject do
{
existing: {
key: :hello
}
}.bottomless
end
it 'is a BottomlessHash now' do
expect(subject).to be_a BottomlessHash
end

it 'returns values for existing keys' do
expect(subject[:existing][:key]).to eq :hello
end

it 'bottomlessly stores values' do
subject[:new][:value] = :omg
expect(subject[:new][:value]).to eq :omg
end

it 'does not raise error on missing keys' do
expect do
subject[:missing][:key]
end.to_not raise_error
end
end

0 comments on commit ca2c44c

Please sign in to comment.