response_code_matchers 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 53a4b159cf5c12f38193d963b5d20c3f3a9c1a11
4
+ data.tar.gz: 506c56a352ef4b15511c3776478f2d2d51fba7a7
5
+ SHA512:
6
+ metadata.gz: 97002e3666789d2a8ff9ec70e3c5688684cda240ab3eb0e87fea16ac5e6b3a27d564793f3f851a9b930ff4936d3378b52956fe38dab942ccd8859e2f1cf2b71d
7
+ data.tar.gz: 0fcefa8525c5d407246dae671de0d73c6fe61b4005bb4096842ce3620d23bea9176c7f91a700314da33824bf52d1006fd88907db8812b20c82505a09c1e140c4
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ gemfile:
3
+ - gemfiles/rspec-2.14.gemfile
4
+ - gemfiles/rspec-3.0.gemfile
5
+ - gemfiles/rspec-2.99.gemfile
6
+
7
+ script: 'bundle exec rspec'
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # ResponseCodeMatchers
2
2
 
3
3
  Provide rspec matchers to match http response code.
4
- The receiver of this matcher should have `#code` method which returns http status code.
4
+ The receiver of this matcher should have `#code` or `#status` method which returns http status code.
5
5
 
6
6
  ## Installation
7
7
  ```
@@ -63,6 +63,7 @@ end
63
63
  [Rack::Response](https://github.com/rack/rack/blob/master/lib/rack/response.rb) has predicative methods like `#not_found?`, `#bad_request?`, and etc. so we can use `response.should be_not_found` without this gem.
64
64
 
65
65
  There are 2 advantages to use this gem.
66
+
66
67
  1. The range of differences that Rack::Response does not have
67
68
  2. Useful failure messages for each failed reason
68
69
 
@@ -70,7 +71,7 @@ There are 2 advantages to use this gem.
70
71
  # without response_code_matchers.gem
71
72
  expected not_found? to return true, got false
72
73
 
73
- # with response_code_matchers.gem
74
+ # with response_code_matchers.gem
74
75
  expected response code to be 404, but 400
75
76
  ```
76
77
 
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rspec', '~> 2.14.0'
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rspec', '~> 2.99.0.beta1'
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rspec', '~> 3.0.0.beta1'
4
+
5
+ gemspec path: '../'
@@ -1,3 +1,3 @@
1
1
  module ResponseCodeMatchers
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -44,7 +44,7 @@ module ResponseCodeMatchers
44
44
  end
45
45
  end
46
46
 
47
- def negative_failure_message
47
+ def failure_message_when_negated
48
48
  if @valid
49
49
  "expected response code not to be #@expected, but #@actual"
50
50
  else
@@ -56,32 +56,32 @@ describe ResponseCodeMatchers do
56
56
  ].each_slice(2) do |code, matcher|
57
57
  describe "##{matcher}" do
58
58
  let(:response) do
59
- mock(:code => code)
59
+ double(:code => code)
60
60
  end
61
61
 
62
62
  it "matches http response code #{code}" do
63
- response.should send(matcher)
63
+ expect(response).to send(matcher)
64
64
  end
65
65
  end
66
66
  end
67
67
 
68
68
  context "when receiver responds to #status" do
69
69
  let(:receiver) do
70
- mock(:status => 406)
70
+ double(:status => 406)
71
71
  end
72
72
 
73
73
  it "calls original receiver.xxx?" do
74
- receiver.should be_not_acceptable
74
+ expect(receiver).to be_not_acceptable
75
75
  end
76
76
  end
77
77
 
78
78
  context "when receiver does not have a method #code" do
79
79
  let(:receiver) do
80
- mock(:accepted? => true)
80
+ double(:accepted? => true)
81
81
  end
82
82
 
83
83
  it "calls original receiver.xxx?" do
84
- receiver.should be_accepted
84
+ expect(receiver).to be_accepted
85
85
  end
86
86
  end
87
87
  end
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  require "response_code_matchers"
2
2
 
3
3
  RSpec.configure do |config|
4
+ if config.respond_to?(:raise_errors_for_deprecations!)
5
+ config.raise_errors_for_deprecations!
6
+ end
4
7
  config.treat_symbols_as_metadata_keys_with_true_values = true
5
8
  config.run_all_when_everything_filtered = true
6
9
  config.filter_run :focus
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: response_code_matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
5
- prerelease:
4
+ version: 0.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ryo NAKAMURA
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-23 00:00:00.000000000 Z
11
+ date: 2014-03-12 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rack
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description: Provide rspec matchers to match http response code
@@ -51,10 +46,14 @@ extensions: []
51
46
  extra_rdoc_files: []
52
47
  files:
53
48
  - .gitignore
49
+ - .travis.yml
54
50
  - Gemfile
55
51
  - LICENSE.txt
56
52
  - README.md
57
53
  - Rakefile
54
+ - gemfiles/rspec-2.14.gemfile
55
+ - gemfiles/rspec-2.99.gemfile
56
+ - gemfiles/rspec-3.0.gemfile
58
57
  - lib/response_code_matchers.rb
59
58
  - lib/response_code_matchers/version.rb
60
59
  - response_code_matchers.gemspec
@@ -62,27 +61,26 @@ files:
62
61
  - spec/spec_helper.rb
63
62
  homepage: https://github.com/r7kamura/response_code_matchers
64
63
  licenses: []
64
+ metadata: {}
65
65
  post_install_message:
66
66
  rdoc_options: []
67
67
  require_paths:
68
68
  - lib
69
69
  required_ruby_version: !ruby/object:Gem::Requirement
70
- none: false
71
70
  requirements:
72
- - - ! '>='
71
+ - - '>='
73
72
  - !ruby/object:Gem::Version
74
73
  version: '0'
75
74
  required_rubygems_version: !ruby/object:Gem::Requirement
76
- none: false
77
75
  requirements:
78
- - - ! '>='
76
+ - - '>='
79
77
  - !ruby/object:Gem::Version
80
78
  version: '0'
81
79
  requirements: []
82
80
  rubyforge_project:
83
- rubygems_version: 1.8.24
81
+ rubygems_version: 2.0.3
84
82
  signing_key:
85
- specification_version: 3
83
+ specification_version: 4
86
84
  summary: RSpec utility matchers for http response code
87
85
  test_files:
88
86
  - spec/response_code_matchers_spec.rb