api_matchers 0.5.0 → 0.5.1

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: e256da4250d9b304bed9733e30b1949b13f60c27
4
- data.tar.gz: 361d34707eafd42661b8dea22bdaa95470eb8632
3
+ metadata.gz: 8551de9e183566d4d82c9826172b6a181a6daf74
4
+ data.tar.gz: d3caa8d552bb7f52708b80675b36a051b8f91464
5
5
  SHA512:
6
- metadata.gz: 35c9a63f902431792e244e97a8b6f11307b7b4afc5cb8250a960b43039b3e2aadce22321347c3cf00536169f5074449dfeadccc994ee72275935a26ffd5c206e
7
- data.tar.gz: 803747cf15d4d5d461a5ad23d84541a6ede2a878a08e34e5e0808967c35136fb25493b80aaf98bb219fa851c91ce4368ef42c735b872a9ebdb9f7145f6a129bb
6
+ metadata.gz: 2d1b9058f255957ad59f53098e2287c26c09c5cd0bc1a76bf2aae1cb7e1f0acfdcf541d32dddf5c38450894aeb5c9018ac57a4a1cf6033b6b1ea0e4f7dfa9afc
7
+ data.tar.gz: 133ca4527a7a9f2e166ae16826bef9ce6420d170e1b7f0bbbfe67ad1fb6562bb14a7f7c79a1f52f36e64b571bfb0262c7fd03887487621f02d6dbdcb50a0c740
data/History.markdown CHANGED
@@ -1,4 +1,8 @@
1
- ## development
1
+ ## 0.5.1
2
+
3
+ * Fix #have_json matcher fail message. Fix issue #20
4
+
5
+ ## 0.5.0
2
6
 
3
7
  * Internals - Migrate to the RSpec expect syntax.
4
8
 
@@ -16,9 +16,7 @@ module APIMatchers
16
16
  def content_type_response
17
17
  if @setup.header_method.present? and @setup.header_content_type_key.present?
18
18
  headers = @actual.send(@setup.header_method)
19
- if headers.present?
20
- headers[@setup.header_content_type_key] || headers
21
- end
19
+ headers[@setup.header_content_type_key] || headers if headers.present?
22
20
  else
23
21
  @actual
24
22
  end
@@ -15,7 +15,7 @@ module APIMatchers
15
15
  end
16
16
 
17
17
  def failure_message
18
- "expect to have json: '#{response_body}'. Got: '#{json}'."
18
+ "expect to have json: '#{expected_json}'. Got: '#{json}'."
19
19
  end
20
20
 
21
21
  def failure_message_when_negated
@@ -1,3 +1,3 @@
1
1
  module APIMatchers
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -13,10 +13,10 @@ describe APIMatchers::ResponseBody::HaveJson do
13
13
  end
14
14
 
15
15
  context 'when fails' do
16
- it 'different json' do
16
+ it 'fails with the expected response nd the actual body in the fail message' do
17
17
  expect {
18
18
  expect(['Petshop', 'Cats'].to_json).to have_json(['Petshop', 'Dogs'])
19
- }.to fail_with(%Q{expect to have json: '["Petshop","Cats"]'. Got: '["Petshop", "Cats"]'.})
19
+ }.to fail_with(%Q{expect to have json: '["Petshop", "Dogs"]'. Got: '["Petshop", "Cats"]'.})
20
20
  end
21
21
  end
22
22
  end
@@ -29,7 +29,7 @@ describe APIMatchers::ResponseBody::HaveJson do
29
29
  end
30
30
 
31
31
  context 'when fails' do
32
- it 'equal json' do
32
+ it 'equal json returns the fail message for expect not to' do
33
33
  expect {
34
34
  expect(['Petshop', 'Cats'].to_json).not_to have_json(['Petshop', 'Cats'])
35
35
  }.to fail_with(%Q{expect to NOT have json: '["Petshop","Cats"]'.})
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas D'Stefano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-11 00:00:00.000000000 Z
11
+ date: 2014-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.14'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.14'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 3.2.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 3.2.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.5.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.5.2
55
55
  description: Collection of RSpec matchers for create your API.
@@ -59,10 +59,10 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - .gitignore
63
- - .rspec
64
- - .rvmrc.example
65
- - .travis.yml
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - ".rvmrc.example"
65
+ - ".travis.yml"
66
66
  - Gemfile
67
67
  - History.markdown
68
68
  - LICENSE
@@ -121,17 +121,17 @@ require_paths:
121
121
  - lib
122
122
  required_ruby_version: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - '>='
124
+ - - ">="
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.0.5
134
+ rubygems_version: 2.2.2
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Collection of RSpec matchers for create your API.