pigeon_hole 0.1.6 → 0.1.7

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: 706952f2c2f0ca67d0aafca1db9d9adadfac728e
4
- data.tar.gz: 991c0e967ed1c8b1a6863c985d4fe1328c531075
3
+ metadata.gz: 123fba48e58f496fd52022df7fea6e6adede23d6
4
+ data.tar.gz: 872065a790ede251a1a334fb9209288650f0a1ff
5
5
  SHA512:
6
- metadata.gz: ad6440197be629b26bd60880373a263a78bef20209b301a6fd5466606a0ee769bebdf313ac18eec1894c60c1ae78b1ad823859bfa2569f73cab060e0f7df9079
7
- data.tar.gz: 67f9d3926b38a53381e4daf84d7c3d603ac79d786bd8406d42320d55a8ebc01b267bdb6e21daf50b6d11e447746eb1e194436af02ab22ed1798f689153dc7ae4
6
+ metadata.gz: 2cd3cf6de97c561d1d68ac1d65cb0344b66b4623ff2dbc0f0b4201d216b4fea0a77809803bdc6c385668d51effcacd98de7661d2d2aaa26ffc8b03ea42ea9e16
7
+ data.tar.gz: b1fa932d5624dea8b6e529e88e3146b130bff1703bb5bdfd292955a4f570d571ab0f2b8d043a1c2b71f8060f3b9c505661c6e1de2996f55250130a2bc0afa245
@@ -106,6 +106,8 @@ module PigeonHole
106
106
 
107
107
  def self.serialize_value(value)
108
108
  case value
109
+ when String
110
+ value.tr("\u0000", "")
109
111
  when *BASIC_TYPES
110
112
  value
111
113
  when Hash
@@ -36,6 +36,25 @@ describe "serializing times" do
36
36
  end
37
37
  end
38
38
 
39
+ describe "serializing unicode strings" do
40
+ let(:string) { "Test \u0000example" }
41
+ let(:sanitized_string) { "Test example" }
42
+
43
+ subject { PigeonHole.generate(string: string) }
44
+
45
+ it "serializes hash into a string" do
46
+ result = subject
47
+ expect(result).to_not be_empty
48
+ end
49
+
50
+ it "can be deserialized to a string" do
51
+ result = subject
52
+ hash = PigeonHole.parse(result)
53
+ expect(hash).to eq({ "string" => sanitized_string })
54
+ expect(hash["string"]).to be_a(String)
55
+ end
56
+ end
57
+
39
58
  describe "serializing symbols" do
40
59
  let(:symbol) { :a_symbol }
41
60
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pigeon_hole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Binns
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-21 00:00:00.000000000 Z
11
+ date: 2017-02-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -44,11 +44,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  version: '0'
45
45
  requirements: []
46
46
  rubyforge_project:
47
- rubygems_version: 2.6.7
47
+ rubygems_version: 2.6.8
48
48
  signing_key:
49
49
  specification_version: 4
50
50
  summary: Opt-in typed serialization for complex JSON types
51
51
  test_files:
52
52
  - spec/integration_spec.rb
53
53
  - spec/spec_helper.rb
54
- has_rdoc: