Skip to content

Commit 948cb11

Browse files
committed
Display scope in html examples
Closes #116
1 parent fc27d98 commit 948cb11

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

features/html_documentation.feature

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Feature: Generate HTML documentation from test examples
2626
resource "Greetings" do
2727
get "/greetings" do
2828
parameter :target, "The thing you want to greet"
29+
parameter :scoped, "This is a scoped variable", :scope => :scope
2930
3031
example "Greeting your favorite gem" do
3132
do_request :target => "rspec_api_documentation"
@@ -60,8 +61,9 @@ Feature: Generate HTML documentation from test examples
6061
When I open the index
6162
And I navigate to "Greeting your favorite gem"
6263
Then I should see the following parameters:
63-
| name | description |
64-
| target | The thing you want to greet |
64+
| name | description |
65+
| target | The thing you want to greet |
66+
| scope[scoped] | This is a scoped variable |
6567

6668
Scenario: Example HTML documentation includes the request information
6769
When I open the index

templates/rspec_api_documentation/html_example.mustache

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@
5353
{{# parameters }}
5454
<tr>
5555
<td{{# required }} class="required"{{/ required }}>
56-
<span class="name">{{ name }}</span>
56+
{{# scope }}
57+
<span class="name">{{ scope }}[{{ name }}]</span>
58+
{{/ scope }}
59+
{{^ scope }}
60+
<span class="name">{{ name }}</span>
61+
{{/ scope }}
5762
</td>
5863
<td>
5964
<span class="description">{{ description }}</span>

0 commit comments

Comments
 (0)