strong_json 0.0.1 → 0.0.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: 87d564cb26c5d9ed754f678b8457500a559bdc59
4
- data.tar.gz: 9295697d16ad7e6bae591d2fba87c8faac18032e
3
+ metadata.gz: 8dd02d60911a8cb479b95b9dca2cdd78eacc4865
4
+ data.tar.gz: 92734473d82322d597c54ef94747c09af792b97f
5
5
  SHA512:
6
- metadata.gz: af91e4213775d941fdaba00e8eaedc6b00794505b02ae9d1b1f43d9d1ae0e52931adc7a1a7b5c041052a6bcd09bd409c6397e6257734ef6006a634f3c9daeaf6
7
- data.tar.gz: 223485b1b051ee4651840797e064607160858b25223472a5b4fafc1be063ca329ab343b9d9224fc7d2306cf1d38ae1cf32aa28b63252c59eb603aae541ba7865
6
+ metadata.gz: ea0b6e642d0a2565aea4ad6227b10f3a1755945e1c303a634e0815254cfb95d820623e81c21ba1cb6aebb41401b61378cb00581d3f33a36ded049e188505fd54
7
+ data.tar.gz: a2aa9419a7d3e9e26e611cf6605c017414491b5439c31fa0c7d85b211ebe3c96a9d78c5f4f3e37d34572a7189a001a577195d7f1ee2b2bc8bd9f75a455b40650
@@ -8,7 +8,7 @@ class StrongJSON
8
8
  end
9
9
 
10
10
  def let(name, type)
11
- define_method(name) { type }
11
+ define_singleton_method(name) { type }
12
12
  end
13
13
 
14
14
  include StrongJSON::Types
@@ -1,3 +1,3 @@
1
1
  class StrongJSON
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,8 +1,10 @@
1
+ require "strong_json"
2
+
1
3
  describe "StrongJSON.new" do
2
4
  it "tests the structure of a JSON object" do
3
5
  s = StrongJSON.new do
4
- let :item, object(id: prohibited, name: string, count: numeric, price: numeric)
5
- let :checkout, object(id: prohibited, items: array(item), change: optional(number))
6
+ let :item, object(name: string, count: numeric, price: numeric)
7
+ let :checkout, object(items: array(item), change: optional(number))
6
8
  end
7
9
 
8
10
  expect(s.checkout.coerce(items: [ { name: "test", count: 1, price: "2.33", comment: "dummy" } ])).to eq(items: [ { name: "test", count: 1, price: "2.33" }])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-11 00:00:00.000000000 Z
11
+ date: 2015-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,9 +72,9 @@ files:
72
72
  - spec/array_spec.rb
73
73
  - spec/basetype_spec.rb
74
74
  - spec/error_spec.rb
75
+ - spec/json_spec.rb
75
76
  - spec/object_spec.rb
76
77
  - spec/optional_spec.rb
77
- - spec/spec.rb
78
78
  - strong_json.gemspec
79
79
  homepage: ''
80
80
  licenses:
@@ -104,6 +104,6 @@ test_files:
104
104
  - spec/array_spec.rb
105
105
  - spec/basetype_spec.rb
106
106
  - spec/error_spec.rb
107
+ - spec/json_spec.rb
107
108
  - spec/object_spec.rb
108
109
  - spec/optional_spec.rb
109
- - spec/spec.rb