xml_matchers 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +7 -3
- data/lib/xml_matchers.rb +1 -1
- data/lib/xml_matchers/version.rb +1 -1
- data/xml_matchers.gemspec +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: 34ae6d741334dce12bd706e50e7ee12e7b5dfa26
|
4
|
+
data.tar.gz: 2f52c6a6a2d9c0c117030b9baed63ba0b15723ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ada0b7bcf8a47ba0d519b762a00795d451a15b3eb4b8364efae6c1487b6f7e72dbea502b098192c68a531cff664c7452d1a75e5fa5bfaed817b445e3f0afcbab
|
7
|
+
data.tar.gz: e8d4eb5971a721d0981269446b9987a2daa19d0e76d21e17585fb50eaf9ee8fb84b37dbaa2c44c8084c7dd56b44f19d25b4a796c7523ce7b892a4f15c56ae293
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
xml_matchers (0.
|
5
|
-
nokogiri (~> 1.8.4)
|
4
|
+
xml_matchers (0.2.0)
|
6
5
|
|
7
6
|
GEM
|
8
7
|
remote: https://rubygems.org/
|
@@ -51,6 +50,7 @@ PLATFORMS
|
|
51
50
|
DEPENDENCIES
|
52
51
|
bundler (~> 1.16)
|
53
52
|
factory_bot (>= 4.8)
|
53
|
+
nokogiri (~> 1.8.4)
|
54
54
|
pry
|
55
55
|
rake (~> 10.0)
|
56
56
|
rspec (~> 3.0)
|
data/README.md
CHANGED
@@ -36,9 +36,9 @@ require "xml_matchers/rspec"
|
|
36
36
|
|
37
37
|
## Declare
|
38
38
|
|
39
|
-
Declare your XML Schema
|
39
|
+
Declare your XML Schema wherever you see fit for your project structure:
|
40
40
|
|
41
|
-
`spec/support/xml/schemas/
|
41
|
+
eg. `spec/support/xml/schemas/locations.xsd`
|
42
42
|
|
43
43
|
## Validate
|
44
44
|
|
@@ -47,11 +47,15 @@ Validate an XML response or an String against an XML schema with
|
|
47
47
|
|
48
48
|
```ruby
|
49
49
|
describe "GET /locations" do
|
50
|
+
let(:locations_xml_schema) do
|
51
|
+
File.read("#{File.pwd}/spec/support/xml/schemas/locations.xsd")
|
52
|
+
end
|
53
|
+
|
50
54
|
it "returns locations" do
|
51
55
|
get locations_path, format: :xml
|
52
56
|
|
53
57
|
expect(response.status).to eq 200
|
54
|
-
expect(response.body).to match_xml_schema(
|
58
|
+
expect(response.body).to match_xml_schema(locations_xml_schema)
|
55
59
|
end
|
56
60
|
end
|
57
61
|
```
|
data/lib/xml_matchers.rb
CHANGED
data/lib/xml_matchers/version.rb
CHANGED
data/xml_matchers.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
33
|
spec.require_paths = ["lib"]
|
34
34
|
|
35
|
-
spec.
|
35
|
+
spec.add_development_dependency "nokogiri", "~> 1.8.4"
|
36
36
|
spec.add_development_dependency "bundler", "~> 1.16"
|
37
37
|
spec.add_development_dependency "rake", "~> 10.0"
|
38
38
|
spec.add_development_dependency "rspec", "~> 3.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xml_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cored
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.8.4
|
20
|
-
type: :
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|