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 +5 -5
- data/Gemfile +6 -0
- data/README.md +4 -2
- data/lib/rspec/document_requests/configuration.rb +2 -2
- data/lib/rspec/document_requests/dsl.rb +12 -2
- data/lib/rspec/document_requests/explanation.rb +4 -4
- data/lib/rspec/document_requests/version.rb +1 -1
- data/rspec-document_requests.gemspec +5 -5
- metadata +16 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4fce2fbb676dbc55a1841dffea7c9c034dd05271611cda5ce966c6d8c05be79f
|
4
|
+
data.tar.gz: 562a881a31d20bdb8627b76abb891a36a772b5b236e6cc41197813cb8f1707f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2ffdf0b2e440c5a49d76e26537c623538f09135c8f6f83940a61f9082a9a7b79d55bdad489258f92ea114c8f1050dd9f140acb654459a10af75b846be537216
|
7
|
+
data.tar.gz: eafa2c2ba74e40b9a9a8ee32991210794176bbe74129366a58f7ed3dc4dfe997afc1eb2aae6049bfd6acd6f12aa03b71548df4287e5970eae8aae178c723c4f1
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -281,8 +281,10 @@ end
|
|
281
281
|
|
282
282
|
## Development
|
283
283
|
|
284
|
-
|
285
|
-
|
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
|
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,
|
11
|
-
result = super(path,
|
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,
|
13
|
-
@parameters[name] = Request::Parameter.new(
|
12
|
+
def parameter(name, ...)
|
13
|
+
@parameters[name] = Request::Parameter.new(...)
|
14
14
|
end
|
15
15
|
|
16
|
-
def header(name,
|
17
|
-
@headers[name] = Request::Parameter.new(
|
16
|
+
def header(name, ...)
|
17
|
+
@headers[name] = Request::Parameter.new(...)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -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 = "
|
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 = ">=
|
23
|
-
spec.add_runtime_dependency "rspec-rails", "
|
22
|
+
spec.required_ruby_version = ">= 3.0"
|
23
|
+
spec.add_runtime_dependency "rspec-rails", "~> 6.1"
|
24
24
|
|
25
|
-
spec.add_development_dependency "bundler", "~>
|
26
|
-
spec.add_development_dependency "rake", "~>
|
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.
|
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:
|
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: '
|
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: '
|
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: '
|
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: '
|
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: '
|
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: '
|
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
|
-
-
|
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: '
|
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
|
-
|
104
|
-
|
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: []
|