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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f804bef576b5eb020767f2b84e25692f5e14225e
4
- data.tar.gz: d940ccbb14d096153d58bba091b0f663c155732a
3
+ metadata.gz: 68b1658e2e48715aa95963b7dc9f5553ae49e6e4
4
+ data.tar.gz: d3536a05e44aaf06757f027d3883e9e9f4af0198
5
5
  SHA512:
6
- metadata.gz: 1616399a1d6caf634f18f4a59682fdf56b2fd9a1e257851fc06a904b7741b9cedd18f09e7b758ef8ed3ebb3df88bb1adf7f6b4d216902365a4bf334437810fb0
7
- data.tar.gz: 5ed37b4b4c32cfe7ff89561690ba347b8f42827a58e32931643a69d23ebfadcd8f414abb255ed34e1a66e5b0f4910e4f4bb334fea2c0937e3997d3bba1cb60ea
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
@@ -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-rails", ">= 2.0"
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
- mattr_accessor :schema_root
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
 
@@ -44,6 +44,8 @@ not to match schema "#{schema_name}":
44
44
  FAIL
45
45
  end
46
46
 
47
+ private
48
+
47
49
  def pretty_json(json_string)
48
50
  JSON.pretty_generate(JSON.parse(json_string.to_s))
49
51
  end
@@ -1,3 +1,3 @@
1
1
  module JsonMatchers
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
@@ -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
- expect(error.message.squish).to include(error_message)
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.to_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.1
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-rails
70
+ name: rspec
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - ">="