schema_conformist 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/schema_conformist/driver.rb +9 -5
- data/lib/schema_conformist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec3485574ecb3f1b4165d470a4ba8cf9cfea2afd
|
|
4
|
+
data.tar.gz: 6e1672078fc76c513aef48521a2220d755c7c860
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b04cd4aeeae5d0476c412553a7372ed4cfb955b7468b624b82e68d38313e3022e56e2ec22defcb0ae8d70017e3cc0502d8a85a9168f409dcec1c25efb97edf76
|
|
7
|
+
data.tar.gz: '07193a36056c3e848b1c0e3dfe2f9fcc3d33c439e944f1ed85dc7847a9c78133a195d9f8dc79ddaa227c68b665ad00ee1cd1044da9b29f10aa69d30fca41ed74'
|
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# SchemaConformist
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/rb/schema_conformist) [](https://circleci.com/gh/kymmt90/schema_conformist)
|
|
4
|
+
|
|
3
5
|
> An automatic JSON response validator for testing in Rails
|
|
4
6
|
|
|
5
7
|
SchemaConformist is an automatic JSON response validator for your API testing in Rails.
|
|
@@ -3,11 +3,15 @@ module SchemaConformist
|
|
|
3
3
|
include Committee::Rails::Test::Methods
|
|
4
4
|
|
|
5
5
|
def committee_schema
|
|
6
|
-
@committee_schema ||=
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
@committee_schema ||= driver.parse(schema_hash)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def schema_hash(schema_data = File.read(schema_path))
|
|
10
|
+
if %w(.yaml .yml).include?(File.extname(schema_path))
|
|
11
|
+
YAML.safe_load(schema_data)
|
|
12
|
+
else
|
|
13
|
+
JSON.parse(schema_data)
|
|
14
|
+
end
|
|
11
15
|
end
|
|
12
16
|
|
|
13
17
|
def schema_path
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: schema_conformist
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kohei Yamamoto
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|