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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80a8be98f7c277aca8255bb40db37c91d28a9474
4
- data.tar.gz: 90240ec89e16dc95af7a743def2601d60676973f
3
+ metadata.gz: 34ae6d741334dce12bd706e50e7ee12e7b5dfa26
4
+ data.tar.gz: 2f52c6a6a2d9c0c117030b9baed63ba0b15723ed
5
5
  SHA512:
6
- metadata.gz: ff91a7f7ceb0f5da84a4971126b3944869f35789cc9c275ecfbc8f923a333df77063b17aa23790d15e3147ff17b1987fe4e17df7c13ce7b0d14b931de35f3922
7
- data.tar.gz: bea9877254293989c2327d2779b6ad972c246e2a102f247bb02dd2023a4bec6b31e12d5a917200b9b70d4ecaea78a2973342b0e66f735fc950de64d138afa165
6
+ metadata.gz: ada0b7bcf8a47ba0d519b762a00795d451a15b3eb4b8364efae6c1487b6f7e72dbea502b098192c68a531cff664c7452d1a75e5fa5bfaed817b445e3f0afcbab
7
+ data.tar.gz: e8d4eb5971a721d0981269446b9987a2daa19d0e76d21e17585fb50eaf9ee8fb84b37dbaa2c44c8084c7dd56b44f19d25b4a796c7523ce7b892a4f15c56ae293
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xml_matchers (0.1.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 in the schema directory:
39
+ Declare your XML Schema wherever you see fit for your project structure:
40
40
 
41
- `spec/support/xml/schemas/location.xsd`
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("locations")
58
+ expect(response.body).to match_xml_schema(locations_xml_schema)
55
59
  end
56
60
  end
57
61
  ```
@@ -12,7 +12,7 @@ RSpec::Matchers.define :match_xml_schema do |schema_content|
12
12
  raise XmlMatchers::InvalidSchemaError
13
13
  end
14
14
 
15
- build_schema_for(schema_content)
15
+ schema = build_schema_for(schema_content)
16
16
 
17
17
  match do |xml|
18
18
  document = Nokogiri::XML(xml)
@@ -1,3 +1,3 @@
1
1
  module XmlMatchers
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -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.add_dependency "nokogiri", "~> 1.8.4"
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.1.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: :runtime
20
+ type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements: