rspec-document_requests 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f229f7cf9a8e4fcb4d90515015a169d7960be159
4
- data.tar.gz: c6d9c232d90e20e64e886dd7647bcd35f829cfce
3
+ metadata.gz: de229a50116f4c39157c491227820d86170e701e
4
+ data.tar.gz: 2c481ab74dc8214538cac36f11f0eb4faa35c010
5
5
  SHA512:
6
- metadata.gz: b89fffd618c1105740a270287f23bc7bdeb9ef9b77c2557e12c097926af1a08f58f2a39cbf79539cbb72fcc7daf1a168d2f2001a7f419a960c7a0e3f7cb85cef
7
- data.tar.gz: 763953cc2191e23a0fc1109c648682fb64f1700508ec83ee9a0657f87446278bfc63f425ccfb7cd20ea85835c95ba5b4dc9fb4bf4cbbdf5196725a53585ba5cf
6
+ metadata.gz: 9e926f900d0c4730e66621ed3fdb0e1fd6244046619e9e7b521ffd1850ff98e434cfc73456bb0b8fcf90858b17e484ed37d5a9018ae7502dcf6f7215ffbd0f96
7
+ data.tar.gz: cf91e30efdb92ebb494f1c93fa2a8f1c865e93a04ba90ef101b59fb4a7d9c152a90a3cbfdda3e43540433f552e5a576deb66b8a1dd4b8d428939b8f65a986154
data/Gemfile CHANGED
@@ -2,3 +2,9 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rspec-document_requests.gemspec
4
4
  gemspec
5
+
6
+ if ar_version = ENV['AR']
7
+ gem 'actionpack', ar_version
8
+ else
9
+ gem 'actionpack', github: 'rails/rails'
10
+ end
data/README.md CHANGED
@@ -281,8 +281,10 @@ end
281
281
 
282
282
  ## Development
283
283
 
284
- After checking out the repo, run `bin/setup` to install dependencies.
285
- Then, run `bin/console` for an interactive prompt that will allow you to experiment.
284
+ 1. Pick an Active Record version to develop against, then export it: `export AR=4.2.6`.
285
+ 2. Run `bin/setup` to install dependencies.
286
+ 3. Run `rspec` to run the specs.
287
+
286
288
 
287
289
  ## Contributing
288
290
 
@@ -14,8 +14,8 @@ module RSpec
14
14
  add_property :writer, Writers::Markdown
15
15
  add_property :filename_generator, -> (name) { name.downcase.gsub(/[_ ]+/, '-') }
16
16
  add_property :response_parser, -> (response) {
17
- case
18
- when response.content_type.json? then JSON.parse(response.body)
17
+ case response.content_type
18
+ when 'application/json' then JSON.parse(response.body)
19
19
  end
20
20
  }
21
21
 
@@ -7,8 +7,18 @@ module RSpec
7
7
  self.documented_requests = []
8
8
 
9
9
  [:get, :post, :patch, :put, :delete, :head].each do |method|
10
- define_method(method) do |path, parameters = nil, headers_or_env = nil|
11
- result = super(path, parameters, headers_or_env)
10
+ define_method(method) do |path, *args|
11
+ result = super(path, *args)
12
+
13
+ if ActionPack::VERSION::MAJOR < 5
14
+ # old signature (https://github.com/rails/rails/blob/v4.2.7.1/actionpack/lib/action_dispatch/testing/integration.rb#L265)
15
+ # def process(method, path, parameters = nil, headers_or_env = nil)
16
+ parameters = args[0]
17
+ else
18
+ # new signature (https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/testing/integration.rb#L204)
19
+ # def process(method, path, params: nil, headers: nil, env: nil, xhr: false, as: nil)
20
+ parameters = (args[0] || {})[:params]
21
+ end
12
22
 
13
23
  if not @document_requests_prevented and @currently_documented_example
14
24
  DSL.documented_requests << Request.new(
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module DocumentRequests
3
- VERSION = "1.3.1"
3
+ VERSION = "1.3.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-document_requests
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oded Niv
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-29 00:00:00.000000000 Z
11
+ date: 2016-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.4.7
104
+ rubygems_version: 2.5.1
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Automatically documents requests generated by RSpec examples.