Sha256: 4c1a9477003314224ed4d4c22b2ba4ed008cc1dd01db5f53bcf58ee150bc5ab0

Contents?: true

Size: 548 Bytes

Versions: 5

Compression:

Stored size: 548 Bytes

Contents

require 'spec_helper'

describe TweetStream::Hash do
  it 'should be initialized by passing in an existing hash' do
    TweetStream::Hash.new(:abc => 123)[:abc].should == 123
  end

  it 'should symbolize incoming keys' do
    TweetStream::Hash.new('abc' => 123)[:abc].should == 123
  end

  it 'should allow access via method calls' do
    TweetStream::Hash.new(:abc => 123).abc.should == 123
  end

  it 'should still throw NoMethod for non-existent keys' do
    lambda{TweetStream::Hash.new({}).akabi}.should raise_error(NoMethodError)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tweetstream-1.1.4 spec/tweetstream/hash_spec.rb
tweetstream-1.1.3 spec/tweetstream/hash_spec.rb
tweetstream-1.1.2 spec/tweetstream/hash_spec.rb
tweetstream-1.1.1 spec/tweetstream/hash_spec.rb
tweetstream-1.1.0 spec/tweetstream/hash_spec.rb