shutl_resource 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 421b5b49dd8540c07dcd7f2a80037261df28cb24
4
- data.tar.gz: 8ae00a563b1e2f29986895da4ae5f5f32f7bbb4a
3
+ metadata.gz: 0ddcc271e6cf7f37215c62feb2b2815cafc589b4
4
+ data.tar.gz: 5d289b691593e187a2d02dab517ab41df930edef
5
5
  SHA512:
6
- metadata.gz: 431d839f84c0617422e8ac336c8d3acba9b663d75ee9885b49e3b4bfa150451afb2e82abf6ef1c6e59869b5566d6f69dca0c99f4c6a29dec176e4c337308cdd5
7
- data.tar.gz: e5d11fbb6cfd9b2a6b42f2482720dfa6075c252c572f1e517503e825ac7551842afd479702f7d34bb552a9b105d2332b3ce667e620527c4a287cdf684ba13c9e
6
+ metadata.gz: cfbf27b564aa4ab98cd4af6fe599f277c1baecea7e5e3958003c2c66e93ce8da8dbf57169cadf76529496f48895512bef9ccf32e5eb1ef7ec3be9a36977fe46e
7
+ data.tar.gz: 0936ee3c35a6b740f70479d7599f2b3fdbd38240271176e5d681abf339d6f8d00acf9ed9fc0bb10ebce9bff453d68d568d207a5d3422b0bc021afb2adcf00262
@@ -91,7 +91,7 @@ module Shutl::Resource
91
91
 
92
92
  def split_hash h
93
93
  partitions = h.partition { |key, value| yield key, value }
94
- [Hash[partitions.first], Hash[partitions.last]]
94
+ [Hash[partitions.first].with_indifferent_access, Hash[partitions.last].with_indifferent_access]
95
95
  end
96
96
 
97
97
  def split_url_args args
@@ -1,5 +1,5 @@
1
1
  module Shutl
2
2
  module Resource
3
- VERSION = '1.7.1'
3
+ VERSION = '1.7.2'
4
4
  end
5
5
  end
@@ -347,26 +347,52 @@ describe Shutl::Resource::Rest do
347
347
  to_return(:status => 200, :body => '{"test_rests": [{ "a": "a", "b": 2 }]}', :headers => {})
348
348
  end
349
349
 
350
- let(:result) do
351
- TestRest.all(
352
- auth: 'TOKEN', 'auth' => 'TOKEN',
353
- headers: {some: 'headers'}, 'headers' => {some: 'headers'},
354
- from: 'bob@example.com', 'from' => 'bob@example.com')
355
- end
350
+ context 'accepting symbols as keys in header hash' do
351
+ let(:result) do
352
+ TestRest.all(
353
+ auth: 'TOKEN',
354
+ headers: {some: 'headers'},
355
+ from: 'bob@example.com')
356
+ end
356
357
 
357
- it 'should not have auth token' do
358
- result.first.attributes.should_not have_key('auth')
359
- result.first.attributes.should_not have_key(:auth)
360
- end
358
+ it 'should not have auth token' do
359
+ result.first.attributes.should_not have_key('auth')
360
+ result.first.attributes.should_not have_key(:auth)
361
+ end
361
362
 
362
- it 'should not have headers' do
363
- result.first.attributes.should_not have_key('headers')
364
- result.first.attributes.should_not have_key(:headers)
363
+ it 'should not have headers' do
364
+ result.first.attributes.should_not have_key('headers')
365
+ result.first.attributes.should_not have_key(:headers)
366
+ end
367
+
368
+ it 'should not have from email' do
369
+ result.first.attributes.should_not have_key('from')
370
+ result.first.attributes.should_not have_key(:from)
371
+ end
365
372
  end
366
373
 
367
- it 'should not have from email' do
368
- result.first.attributes.should_not have_key('from')
369
- result.first.attributes.should_not have_key(:from)
374
+ context 'accepting strings as keys in header hash' do
375
+ let(:result) do
376
+ TestRest.all(
377
+ 'auth' => 'TOKEN',
378
+ 'headers' => {some: 'headers'},
379
+ 'from' => 'bob@example.com')
380
+ end
381
+
382
+ it 'should not have auth token' do
383
+ result.first.attributes.should_not have_key('auth')
384
+ result.first.attributes.should_not have_key(:auth)
385
+ end
386
+
387
+ it 'should not have headers' do
388
+ result.first.attributes.should_not have_key('headers')
389
+ result.first.attributes.should_not have_key(:headers)
390
+ end
391
+
392
+ it 'should not have from email' do
393
+ result.first.attributes.should_not have_key('from')
394
+ result.first.attributes.should_not have_key(:from)
395
+ end
370
396
  end
371
397
  end
372
398
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shutl_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Rouchy
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2014-10-17 00:00:00.000000000 Z
16
+ date: 2014-11-13 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: shutl_auth