Sha256: 40df6ec8af95e8dab903f9ce958f353b096ce346c461065807cb2183a38fab1e

Contents?: true

Size: 474 Bytes

Versions: 13

Compression:

Stored size: 474 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'
require File.dirname(__FILE__) + '/../lib/clickatell'

describe Hash do
  it "should return only the keys specified" do
    hash = {:a => 'foo', :b => 'bar', :c => 'baz'}
    hash.only(:a, :b).should == {:a => 'foo', :b => 'bar'}
  end
  
  it "should return only the keys specified, ignoring keys that do not exist" do
    hash = {:a => 'foo', :b => 'bar', :c => 'baz'}
    hash.only(:a, :d).should == {:a => 'foo'}
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
lookout-clickatell-0.8.3 spec/hash_ext_spec.rb
clickatell-0.8.2 spec/hash_ext_spec.rb
clickatell-0.8.1 spec/hash_ext_spec.rb
clickatell-0.8.0 spec/hash_ext_spec.rb
clickatell-ruby19-0.7.1 spec/hash_ext_spec.rb
clickatell-0.7.1 spec/hash_ext_spec.rb
dimiro1-clickatell-0.7.0 spec/hash_ext_spec.rb
clickatell-0.7.0 spec/hash_ext_spec.rb
clickatell-0.6.0 spec/hash_ext_spec.rb
clickatell-0.3.0 spec/hash_ext_spec.rb
clickatell-0.4.1 spec/hash_ext_spec.rb
clickatell-0.5.0 spec/hash_ext_spec.rb
clickatell-0.4.0 spec/hash_ext_spec.rb