json_matchers 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +9 -1
- data/json_matchers.gemspec +1 -2
- data/lib/json_matchers.rb +3 -2
- data/lib/json_matchers/rspec.rb +2 -0
- data/lib/json_matchers/version.rb +1 -1
- data/spec/json_matchers/match_response_schema_spec.rb +6 -1
- data/spec/support/file_helpers.rb +4 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68b1658e2e48715aa95963b7dc9f5553ae49e6e4
|
4
|
+
data.tar.gz: d3536a05e44aaf06757f027d3883e9e9f4af0198
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b9eaabfe5e88f41f459762081a3812896080bceda80d96cec2ade4cbfc0242cf3af9819f207116d784c9bc8869d79ed8fd8bcffad276f4317715c3af1b7170d
|
7
|
+
data.tar.gz: 939c61f64cd34c0f94a0846cf17b18dc61bed92bed78b1adf0f743e74ee6257f8685c1ad31686743f1e531849126dea6ec3a9fa4db985260282c18ae6230ce5f
|
data/NEWS.md
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
master
|
2
2
|
======
|
3
3
|
|
4
|
+
0.6.2
|
5
|
+
=====
|
6
|
+
|
7
|
+
* Remove dependency on Rails. [#47]
|
8
|
+
|
9
|
+
[#47]: https://github.com/thoughtbot/json_matchers/pull/47
|
10
|
+
|
4
11
|
0.6.1
|
5
12
|
=====
|
6
13
|
|
7
|
-
* Configure default options for all matchers.
|
14
|
+
* Configure default options for all matchers. [#46]
|
8
15
|
* Use `JSON.pretty_generate` to format error messages. [#44]
|
9
16
|
|
17
|
+
[#46]: https://github.com/thoughtbot/json_matchers/pull/46
|
10
18
|
[#44]: https://github.com/thoughtbot/json_matchers/pull/44
|
11
19
|
|
12
20
|
0.6.0
|
data/json_matchers.gemspec
CHANGED
@@ -19,10 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency("json-schema", "~> 2.6.0")
|
22
|
-
spec.add_dependency("activesupport", '>= 3.0.0')
|
23
22
|
|
24
23
|
spec.add_development_dependency "bundler", "~> 1.7"
|
25
24
|
spec.add_development_dependency "pry"
|
26
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
-
spec.add_development_dependency "rspec
|
26
|
+
spec.add_development_dependency "rspec", ">= 2.0"
|
28
27
|
end
|
data/lib/json_matchers.rb
CHANGED
@@ -2,10 +2,11 @@ require "json_matchers/version"
|
|
2
2
|
require "json_matchers/configuration"
|
3
3
|
require "json_matchers/matcher"
|
4
4
|
require "json_matchers/errors"
|
5
|
-
require "active_support/all"
|
6
5
|
|
7
6
|
module JsonMatchers
|
8
|
-
|
7
|
+
class << self
|
8
|
+
attr_accessor :schema_root
|
9
|
+
end
|
9
10
|
|
10
11
|
self.schema_root = "#{Dir.pwd}/spec/support/api/schemas"
|
11
12
|
|
data/lib/json_matchers/rspec.rb
CHANGED
@@ -159,7 +159,12 @@ describe JsonMatchers, "#match_response_schema" do
|
|
159
159
|
|
160
160
|
def raise_formatted_error(error_message)
|
161
161
|
raise_error do |error|
|
162
|
-
|
162
|
+
sanitized_message = error.message.
|
163
|
+
gsub(/\A[[:space:]]+/, "").
|
164
|
+
gsub(/[[:space:]]+\z/, "").
|
165
|
+
gsub(/[[:space:]]+/, " ")
|
166
|
+
|
167
|
+
expect(sanitized_message).to include(error_message)
|
163
168
|
end
|
164
169
|
end
|
165
170
|
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require "fileutils"
|
2
|
+
require "json"
|
3
|
+
|
1
4
|
module FileHelpers
|
2
5
|
ORIGINAL_SCHEMA_ROOT = JsonMatchers.schema_root
|
3
6
|
|
@@ -7,7 +10,7 @@ module FileHelpers
|
|
7
10
|
when NilClass, String
|
8
11
|
file.write(json.to_s)
|
9
12
|
else
|
10
|
-
file.write(json
|
13
|
+
file.write(JSON.generate(json))
|
11
14
|
end
|
12
15
|
end
|
13
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Doyle
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.6.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activesupport
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 3.0.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 3.0.0
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +67,7 @@ dependencies:
|
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '10.0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: rspec
|
70
|
+
name: rspec
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - ">="
|