Sha256: a05659b974b5825422810b8bcefcbdad8af803d24af85a1b6cebd2a3b4f5cb87
Contents?: true
Size: 682 Bytes
Versions: 16
Compression:
Stored size: 682 Bytes
Contents
require 'spec_helper' describe Github::API do let(:api) { Github::API.new } before(:each) do @params = { 'a' => { :b => { 'c' => 1 }, 'd' => [ 'a', { :e => 2 }] } } end it "should stringify all the keys inside nested hash" do actual = api.send(:_normalize_params_keys, @params) expected = { 'a' => { 'b'=> { 'c' => 1 }, 'd' => [ 'a', { 'e'=> 2 }] } } actual.should == expected end it "should filter param keys" do valid = ['a', 'b', 'e'] hash = {'a' => 1, 'b' => 3, 'c' => 2, 'd'=> 4, 'e' => 5 } actual = api.send(:_filter_params_keys, valid, hash) expected = {'a' => 1, 'b' => 3, 'e' => 5 } actual.should == expected end end
Version data entries
16 entries across 16 versions & 1 rubygems