rspec-document_requests 1.3.1 → 1.4.0

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
- SHA1:
3
- metadata.gz: f229f7cf9a8e4fcb4d90515015a169d7960be159
4
- data.tar.gz: c6d9c232d90e20e64e886dd7647bcd35f829cfce
2
+ SHA256:
3
+ metadata.gz: 4fce2fbb676dbc55a1841dffea7c9c034dd05271611cda5ce966c6d8c05be79f
4
+ data.tar.gz: 562a881a31d20bdb8627b76abb891a36a772b5b236e6cc41197813cb8f1707f4
5
5
  SHA512:
6
- metadata.gz: b89fffd618c1105740a270287f23bc7bdeb9ef9b77c2557e12c097926af1a08f58f2a39cbf79539cbb72fcc7daf1a168d2f2001a7f419a960c7a0e3f7cb85cef
7
- data.tar.gz: 763953cc2191e23a0fc1109c648682fb64f1700508ec83ee9a0657f87446278bfc63f425ccfb7cd20ea85835c95ba5b4dc9fb4bf4cbbdf5196725a53585ba5cf
6
+ metadata.gz: b2ffdf0b2e440c5a49d76e26537c623538f09135c8f6f83940a61f9082a9a7b79d55bdad489258f92ea114c8f1050dd9f140acb654459a10af75b846be537216
7
+ data.tar.gz: eafa2c2ba74e40b9a9a8ee32991210794176bbe74129366a58f7ed3dc4dfe997afc1eb2aae6049bfd6acd6f12aa03b71548df4287e5970eae8aae178c723c4f1
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, **kwargs|
11
+ result = super(path, *args, **kwargs)
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(
@@ -9,12 +9,12 @@ module RSpec
9
9
  @headers = {}
10
10
  end
11
11
 
12
- def parameter(name, *args)
13
- @parameters[name] = Request::Parameter.new(*args)
12
+ def parameter(name, ...)
13
+ @parameters[name] = Request::Parameter.new(...)
14
14
  end
15
15
 
16
- def header(name, *args)
17
- @headers[name] = Request::Parameter.new(*args)
16
+ def header(name, ...)
17
+ @headers[name] = Request::Parameter.new(...)
18
18
  end
19
19
  end
20
20
 
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module DocumentRequests
3
- VERSION = "1.3.1"
3
+ VERSION = "1.4.0"
4
4
  end
5
5
  end
@@ -12,16 +12,16 @@ Gem::Specification.new do |spec|
12
12
  spec.summary = %q{Automatically documents requests generated by RSpec examples.}
13
13
  spec.description = %q{Use this gem to document your API with your specs.}
14
14
  spec.homepage = "https://github.com/odedniv/rspec-document_requests"
15
- spec.license = "UNLICENSE"
15
+ spec.license = "Unlicense"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
18
  spec.bindir = "exe"
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.required_ruby_version = ">= 2.1"
23
- spec.add_runtime_dependency "rspec-rails", ">= 3.0"
22
+ spec.required_ruby_version = ">= 3.0"
23
+ spec.add_runtime_dependency "rspec-rails", "~> 6.1"
24
24
 
25
- spec.add_development_dependency "bundler", "~> 1.9"
26
- spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "bundler", "~> 2.5"
26
+ spec.add_development_dependency "rake", "~> 13.2"
27
27
  end
metadata CHANGED
@@ -1,57 +1,57 @@
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.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oded Niv
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-29 00:00:00.000000000 Z
11
+ date: 2024-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '6.1'
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
- version: '3.0'
26
+ version: '6.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.9'
33
+ version: '2.5'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.9'
40
+ version: '2.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '13.2'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '13.2'
55
55
  description: Use this gem to document your API with your specs.
56
56
  email:
57
57
  - oded.niv@gmail.com
@@ -83,9 +83,9 @@ files:
83
83
  - rspec-document_requests.gemspec
84
84
  homepage: https://github.com/odedniv/rspec-document_requests
85
85
  licenses:
86
- - UNLICENSE
86
+ - Unlicense
87
87
  metadata: {}
88
- post_install_message:
88
+ post_install_message:
89
89
  rdoc_options: []
90
90
  require_paths:
91
91
  - lib
@@ -93,16 +93,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '2.1'
96
+ version: '3.0'
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
- rubyforge_project:
104
- rubygems_version: 2.4.7
105
- signing_key:
103
+ rubygems_version: 3.5.9
104
+ signing_key:
106
105
  specification_version: 4
107
106
  summary: Automatically documents requests generated by RSpec examples.
108
107
  test_files: []