pebblebed 0.0.51 → 0.0.52

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,11 +22,12 @@ module Pebblebed
22
22
 
23
23
  def another_identity
24
24
  id = current_identity ? (current_identity.id + 1) : 1
25
- DeepStruct.wrap({:id => id, :god => false}.merge(default_identity_options))
25
+ DeepStruct.wrap(deep_stringify_keys({:id => id, :god => false}.merge(default_identity_options)))
26
26
  end
27
27
 
28
28
  private
29
29
  def stub_current_identity(options = {})
30
+
30
31
  guest = options.empty?
31
32
 
32
33
  identity = nil
@@ -34,7 +35,7 @@ module Pebblebed
34
35
  identity = default_identity_options.merge(options)
35
36
  end
36
37
 
37
- @current_identity = DeepStruct.wrap(identity)
38
+ @current_identity = DeepStruct.wrap(deep_stringify_keys(identity))
38
39
 
39
40
  checkpoint = stub(:get => DeepStruct.wrap(:identity => identity), :service_url => 'http://example.com')
40
41
  Pebblebed::Connector.any_instance.stub(:checkpoint => checkpoint)
@@ -53,6 +54,16 @@ module Pebblebed
53
54
  app.any_instance.stub(:current_session).and_return session
54
55
  end
55
56
 
57
+ def deep_stringify_keys(hash)
58
+ if hash and hash.is_a?(Hash)
59
+ hash.keys.each do |key|
60
+ val = hash.delete(key)
61
+ hash[key.to_s] = val.is_a?(Hash) ? val.deep_stringify_keys(val) : val
62
+ end
63
+ end
64
+ hash
65
+ end
66
+
56
67
  end
57
68
  end
58
69
 
@@ -1,3 +1,3 @@
1
1
  module Pebblebed
2
- VERSION = "0.0.51"
2
+ VERSION = "0.0.52"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pebblebed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.51
4
+ version: 0.0.52
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-10 00:00:00.000000000 Z
13
+ date: 2013-04-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec