json_schema_spec 0.0.7 → 0.0.8

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: bf70f1c088dae444228c66e116e4218f9330688d
4
- data.tar.gz: ce429fb15d04d5cd2dcf374bbb3b9e404f125ac8
3
+ metadata.gz: c8fdc6d05168b5673a8df3323e5ec20013706055
4
+ data.tar.gz: a209d077423e0994ede08e330a51e12b446e9caf
5
5
  SHA512:
6
- metadata.gz: 98d692fc82bf5e5362dc908779a1b65c0f9dc000e74e6130c2474e3727bf8b5bcbd889cf91ccb88d08d339d81286b1bc2c267d06c26e2ffe31fee603c19e2e48
7
- data.tar.gz: 545648611bf63ed700c0da46b31ffc428d2d5ebda26b09b1b52efde1c9a483a248938b4c6449133aa41160316e7f9c222cf231a17da808da1b053eb09958781a
6
+ metadata.gz: f309a56c8f687ad0daf4d233336a06ab723d509d193e82b61ad9f71c556171a25683e5c12d14ff23a980f741fc6988264fa70cda5f330eac2b6662360959b2b7
7
+ data.tar.gz: 760a7d2ae493dfa427e7ff86a4a3d85dd9826f21345016da97bc042933008dc5d5622dc47d65336a070e93845ae48c7e39694bae95994967a5243f2da6c6e4ef
@@ -1,6 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.8.7
4
- - 1.9.2
5
- - 1.9.3
6
- - 2.0.0
4
+ - 2.1.0
5
+ before_install:
6
+ - gem update --system 2.1.11
7
+ - gem --version
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Generate fixtures from JSON schemas
4
4
 
5
+ [![Build Status](https://secure.travis-ci.org/winton/json_schema_spec.png)](http://travis-ci.org/winton/json_schema_spec)
6
+
5
7
  ###Goals
6
8
 
7
9
  * Generate webmock requests and responses from JSON schema
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "json_schema_spec"
7
- spec.version = "0.0.7"
7
+ spec.version = "0.0.8"
8
8
  spec.authors = ["Winton Welsh"]
9
9
  spec.email = ["mail@wintoni.us"]
10
10
  spec.description = %q{Generate fixtures from JSON schemas.}
@@ -52,14 +52,14 @@ module JsonSchemaSpec
52
52
  end
53
53
 
54
54
  def json_schema_value(key, value, prefix)
55
- if !value.is_a?(Hash) || value[:optional]
55
+ if !value.is_a?(Hash) || value[:optional] || value[:type] == 'null'
56
56
  nil
57
57
  elsif value[:type] == 'array'
58
58
  [ json_schema_value(key, value[:items], prefix) ]
59
59
  elsif value[:type] == 'boolean'
60
60
  rand(2) == 1
61
61
  elsif value[:type] == 'integer'
62
- Random.rand(1_000_000)
62
+ rand(1_000_000)
63
63
  elsif value[:type] == 'object'
64
64
  json_schema_to_params(value[:properties], prefix << key)
65
65
  elsif value[:type] == 'string'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_schema_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Winton Welsh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-05 00:00:00.000000000 Z
11
+ date: 2014-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json