reqres_rspec 0.0.18 → 0.0.19
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 +4 -4
- data/README.md +3 -3
- data/lib/reqres_rspec/collector.rb +9 -3
- data/lib/reqres_rspec/version.rb +1 -1
- data/lib/reqres_rspec/writers/templates/panel.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ae933f710a7d0f2d94ede0720c9a23cdfc03fc8
|
4
|
+
data.tar.gz: 5642b23a4cdb3b15dfb684a56efd01b93f9c1e73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc223b883e456fcb6d1a195df35920b8003f00517c0934d37c12553c6880c16a755b61868e2b5d3b28e312ce3a6321098091bd620023c14ead2f5cd62a314ec2
|
7
|
+
data.tar.gz: b30f31e8fc315f6b96cf335a731c5ee096629d3c9ac315dd25d75338a5377b9b7374f2956c6ac8f5bf2e503bb1eab8cd3570c57c4e71bd3fd37a80fe7300b762
|
data/README.md
CHANGED
@@ -42,8 +42,8 @@ Documentation will be put into your application's `/doc` folder
|
|
42
42
|
```ruby
|
43
43
|
# @description creates Category from given parameters
|
44
44
|
# description text may be multiline
|
45
|
-
# @
|
46
|
-
# @
|
45
|
+
# @param category[title] required String Category title
|
46
|
+
# @param category[weight] in which order Category will be shown
|
47
47
|
# param text may also be multiline
|
48
48
|
def create
|
49
49
|
category = Category.new(create_category_params)
|
@@ -57,7 +57,7 @@ Documentation will be put into your application's `/doc` folder
|
|
57
57
|
```
|
58
58
|
|
59
59
|
Description param text is started with `@description` and may be multiline.
|
60
|
-
Each param text is started with `@
|
60
|
+
Each param text is started with `@param` and first word will be param name, then optionally `required`, then optionally type (`Integer`, `String` etc), and finally param description, which may be multiline as well.
|
61
61
|
|
62
62
|
### Sample rspec test
|
63
63
|
|
@@ -16,7 +16,9 @@ module ReqresRspec
|
|
16
16
|
# everything that match items from this list will be stripped
|
17
17
|
EXCLUDE_REQUEST_HEADER_PATTERNS = %w[
|
18
18
|
rack.
|
19
|
+
ROUTES_
|
19
20
|
action_dispatch
|
21
|
+
action_controller.
|
20
22
|
REQUEST_METHOD
|
21
23
|
SERVER_NAME
|
22
24
|
SERVER_PORT
|
@@ -28,6 +30,10 @@ module ReqresRspec
|
|
28
30
|
HTTP_USER_AGENT
|
29
31
|
REMOTE_ADDR
|
30
32
|
PATH_INFO
|
33
|
+
ORIGINAL_FULLPATH
|
34
|
+
ORIGINAL_SCRIPT_NAME
|
35
|
+
HTTP_COOKIE
|
36
|
+
HTTP_ORIGIN
|
31
37
|
]
|
32
38
|
|
33
39
|
def initialize
|
@@ -179,7 +185,7 @@ module ReqresRspec
|
|
179
185
|
if line.match /\s*#\s*@description/ # @description blah blah
|
180
186
|
description << line.gsub(/\A\s*#\s*@description/, '').strip
|
181
187
|
comment_lines[(index + 1)..-1].each do |multiline|
|
182
|
-
if !multiline.match /\s*#\s*@
|
188
|
+
if !multiline.match /\s*#\s*@param/
|
183
189
|
description << multiline.gsub(/\A\s*#\s*/, '').strip
|
184
190
|
else
|
185
191
|
break
|
@@ -199,12 +205,12 @@ module ReqresRspec
|
|
199
205
|
text_params = []
|
200
206
|
has_param = false
|
201
207
|
comment_lines.each do |line|
|
202
|
-
if line.match /\s*#\s*@
|
208
|
+
if line.match /\s*#\s*@param/ # @param id required Integer blah blah
|
203
209
|
has_param = true
|
204
210
|
text_params << ''
|
205
211
|
end
|
206
212
|
if has_param
|
207
|
-
line = line.gsub(/\A\s*#\s*@
|
213
|
+
line = line.gsub(/\A\s*#\s*@param/, '').strip
|
208
214
|
line = line.gsub(/\A\s*#\s*/, '').strip
|
209
215
|
text_params.last << line
|
210
216
|
end
|
data/lib/reqres_rspec/version.rb
CHANGED
@@ -97,7 +97,7 @@
|
|
97
97
|
<li>
|
98
98
|
<a href="rspec_doc_<%= (@records.index(record) + 1).to_s.rjust(5, '0') %>.html" target="specs">
|
99
99
|
<span class="method <%= record[:request][:method].downcase %>"><%= record[:request][:method] %></span>
|
100
|
-
<%= record[:
|
100
|
+
<%= record[:title] %><br />
|
101
101
|
</a>
|
102
102
|
</li>
|
103
103
|
<% end %>
|