yard-cucumber2 2.3.3
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 +7 -0
- data/.gitignore +6 -0
- data/.rspec +3 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +37 -0
- data/History.txt +274 -0
- data/LICENSE.txt +22 -0
- data/README.md +188 -0
- data/Rakefile +25 -0
- data/example/README.md +8 -0
- data/example/child_feature/README.md +21 -0
- data/example/child_feature/child.feature +11 -0
- data/example/child_feature/grandchild_feature/grandchild.feature +12 -0
- data/example/empty.feature +2 -0
- data/example/french.feature +18 -0
- data/example/scenario.feature +63 -0
- data/example/scenario_outline.feature +94 -0
- data/example/scenario_outline_multi.feature +15 -0
- data/example/step_definitions/example.step.rb +109 -0
- data/example/step_definitions/first.step.rb +21 -0
- data/example/step_definitions/french_steps.rb +32 -0
- data/example/step_definitions/struct.rb +11 -0
- data/example/step_definitions/support/env.rb +7 -0
- data/example/step_definitions/support/env_support.rb +12 -0
- data/example/step_definitions/support/support.rb +6 -0
- data/example/tags.feature +18 -0
- data/example/transform.feature +13 -0
- data/lib/cucumber/city_builder.rb +331 -0
- data/lib/docserver/default/fulldoc/html/js/cucumber.js +85 -0
- data/lib/docserver/default/layout/html/headers.erb +14 -0
- data/lib/docserver/doc_server/full_list/html/full_list.erb +39 -0
- data/lib/docserver/doc_server/full_list/html/setup.rb +18 -0
- data/lib/templates/default/feature/html/feature.erb +39 -0
- data/lib/templates/default/feature/html/no_steps_defined.erb +1 -0
- data/lib/templates/default/feature/html/outline.erb +56 -0
- data/lib/templates/default/feature/html/pystring.erb +3 -0
- data/lib/templates/default/feature/html/scenario.erb +55 -0
- data/lib/templates/default/feature/html/setup.rb +55 -0
- data/lib/templates/default/feature/html/steps.erb +39 -0
- data/lib/templates/default/feature/html/table.erb +20 -0
- data/lib/templates/default/featuredirectory/html/alpha_table.erb +30 -0
- data/lib/templates/default/featuredirectory/html/directory.erb +32 -0
- data/lib/templates/default/featuredirectory/html/setup.rb +41 -0
- data/lib/templates/default/featuretags/html/namespace.erb +131 -0
- data/lib/templates/default/featuretags/html/setup.rb +34 -0
- data/lib/templates/default/fulldoc/html/css/cucumber.css +227 -0
- data/lib/templates/default/fulldoc/html/directories.erb +53 -0
- data/lib/templates/default/fulldoc/html/full_list_featuredirectories.erb +11 -0
- data/lib/templates/default/fulldoc/html/full_list_features.erb +29 -0
- data/lib/templates/default/fulldoc/html/full_list_stepdefinitions.erb +16 -0
- data/lib/templates/default/fulldoc/html/full_list_steps.erb +17 -0
- data/lib/templates/default/fulldoc/html/full_list_tags.erb +12 -0
- data/lib/templates/default/fulldoc/html/js/cucumber.js +305 -0
- data/lib/templates/default/fulldoc/html/setup.rb +175 -0
- data/lib/templates/default/layout/html/setup.rb +56 -0
- data/lib/templates/default/requirements/html/alpha_table.erb +26 -0
- data/lib/templates/default/requirements/html/requirements.erb +50 -0
- data/lib/templates/default/requirements/html/setup.rb +51 -0
- data/lib/templates/default/steptransformers/html/header.erb +12 -0
- data/lib/templates/default/steptransformers/html/index.erb +10 -0
- data/lib/templates/default/steptransformers/html/setup.rb +94 -0
- data/lib/templates/default/steptransformers/html/transformers.erb +79 -0
- data/lib/templates/default/steptransformers/html/undefinedsteps.erb +26 -0
- data/lib/templates/default/tag/html/alpha_table.erb +32 -0
- data/lib/templates/default/tag/html/setup.rb +27 -0
- data/lib/templates/default/tag/html/tag.erb +35 -0
- data/lib/yard-cucumber.rb +47 -0
- data/lib/yard-cucumber/version.rb +3 -0
- data/lib/yard/code_objects/cucumber/base.rb +32 -0
- data/lib/yard/code_objects/cucumber/feature.rb +18 -0
- data/lib/yard/code_objects/cucumber/namespace_object.rb +49 -0
- data/lib/yard/code_objects/cucumber/scenario.rb +26 -0
- data/lib/yard/code_objects/cucumber/scenario_outline.rb +75 -0
- data/lib/yard/code_objects/cucumber/step.rb +38 -0
- data/lib/yard/code_objects/cucumber/tag.rb +27 -0
- data/lib/yard/code_objects/step_definition.rb +7 -0
- data/lib/yard/code_objects/step_transform.rb +7 -0
- data/lib/yard/code_objects/step_transformer.rb +97 -0
- data/lib/yard/handlers/cucumber/base.rb +21 -0
- data/lib/yard/handlers/cucumber/feature_handler.rb +131 -0
- data/lib/yard/handlers/legacy/step_definition_handler.rb +45 -0
- data/lib/yard/handlers/legacy/step_transform_handler.rb +24 -0
- data/lib/yard/handlers/step_definition_handler.rb +86 -0
- data/lib/yard/handlers/step_transform_handler.rb +31 -0
- data/lib/yard/parser/cucumber/feature.rb +73 -0
- data/lib/yard/server/adapter.rb +43 -0
- data/lib/yard/server/commands/list_command.rb +31 -0
- data/lib/yard/server/router.rb +32 -0
- data/lib/yard/templates/helpers/base_helper.rb +26 -0
- data/yard-cucumber.gemspec +65 -0
- metadata +199 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
def init
|
|
2
|
+
super
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
#
|
|
6
|
+
# Append yard-cucumber stylesheet to yard core stylesheets
|
|
7
|
+
#
|
|
8
|
+
def stylesheets
|
|
9
|
+
super + %w(css/cucumber.css)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
#
|
|
13
|
+
# Append yard-cucumber javascript to yard core javascripts
|
|
14
|
+
#
|
|
15
|
+
def javascripts
|
|
16
|
+
super + %w(js/cucumber.js)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
#
|
|
20
|
+
# Append yard-cucumber specific menus 'features' and 'tags'
|
|
21
|
+
#
|
|
22
|
+
# 'features' and 'tags' are enabled by default.
|
|
23
|
+
#
|
|
24
|
+
# 'step definitions' and 'steps' may be enabled by setting up a value in
|
|
25
|
+
# yard configuration file '~/.yard/config'
|
|
26
|
+
#
|
|
27
|
+
# @example `~/.yard.config`
|
|
28
|
+
#
|
|
29
|
+
# yard-cucumber:
|
|
30
|
+
# menus: [ 'features', 'directories', 'tags', 'step definitions', 'steps' ]
|
|
31
|
+
#
|
|
32
|
+
def menu_lists
|
|
33
|
+
|
|
34
|
+
menus = [ "features", "tags" ]
|
|
35
|
+
|
|
36
|
+
# load the yard-cucumber menus defined in the configuration file
|
|
37
|
+
if YARD::Config.options["yard-cucumber"] and YARD::Config.options["yard-cucumber"]["menus"]
|
|
38
|
+
menus = YARD::Config.options["yard-cucumber"]["menus"]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
menus.map {|menu_name| yard_cucumber_menus[menu_name] }.compact + super
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
#
|
|
45
|
+
# When a menu is specified in the yard configuration file, this hash contains
|
|
46
|
+
# the details about the menu necessary for it to be displayed.
|
|
47
|
+
#
|
|
48
|
+
# @see #menu_lists
|
|
49
|
+
#
|
|
50
|
+
def yard_cucumber_menus
|
|
51
|
+
{ "features" => { :type => 'feature', :title => 'Features', :search_title => 'Features' },
|
|
52
|
+
"directories" => { :type => 'featuredirectories', :title => 'Features by Directory', :search_title => 'Features by Directory' },
|
|
53
|
+
"tags" => { :type => 'tag', :title => 'Tags', :search_title => 'Tags' },
|
|
54
|
+
"step definitions" => { :type => 'stepdefinition', :title => 'Step Definitions', :search_title => 'Step Defs' },
|
|
55
|
+
"steps" => { :type => 'step', :title => 'Steps', :search_title => 'Steps' } }
|
|
56
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<% if @elements && !@elements.empty? %>
|
|
2
|
+
<% i = (@elements.length % 2 == 0 ? 1 : 0) %>
|
|
3
|
+
<table style="margin-left: 10px; width: 100%;">
|
|
4
|
+
<tr>
|
|
5
|
+
<td valign='top' width="50%">
|
|
6
|
+
<% @elements.each do |letter, objects| %>
|
|
7
|
+
<% if (i += 1) > (@elements.length / 2 + 1) %>
|
|
8
|
+
</td><td valign='top' width="50%">
|
|
9
|
+
<% i = 0 %>
|
|
10
|
+
<% end %>
|
|
11
|
+
<ul id="alpha_<%= letter %>" class="alpha">
|
|
12
|
+
<li class="letter"><%= letter %></li>
|
|
13
|
+
<ul>
|
|
14
|
+
<% objects.each do |obj| %>
|
|
15
|
+
<li>
|
|
16
|
+
<%= linkify obj, obj.value %>
|
|
17
|
+
<small>(<%= obj.file %>)</small>
|
|
18
|
+
</li>
|
|
19
|
+
<% end %>
|
|
20
|
+
</ul>
|
|
21
|
+
</ul>
|
|
22
|
+
<% end %>
|
|
23
|
+
</td>
|
|
24
|
+
</tr>
|
|
25
|
+
</table>
|
|
26
|
+
<% end %>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<% if @namespace %>
|
|
2
|
+
<div id="cukes_logo"> </div>
|
|
3
|
+
<div id="cukes_links">
|
|
4
|
+
<a href="http://cukes.info/">Cucumber</a> |
|
|
5
|
+
<a href="http://github.com/cucumber/cucumber/wiki/Gherkin">Gherkin</a> |
|
|
6
|
+
<a href="http://yardoc.org/">YARD</a> |
|
|
7
|
+
<a href="https://github.com/burtlo/yard-cucumber">YARD-Cucumber</a>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div class="requirements">
|
|
11
|
+
|
|
12
|
+
<% if features && !features.empty? %>
|
|
13
|
+
<%= alpha_table(features) %>
|
|
14
|
+
<% else %>
|
|
15
|
+
<!-- No Features Defined -->
|
|
16
|
+
<div class="none">No Features Defined</div>
|
|
17
|
+
<% end %>
|
|
18
|
+
|
|
19
|
+
<div id="directory" style="margin-left: 40px;">
|
|
20
|
+
<div class="title"><span class="name">Tags</span></div>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="tags">
|
|
23
|
+
<%= tags.collect {|tag| linkify(tag,tag.value) }.join(",\n") %>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<% if feature_subdirectories && !feature_subdirectories.empty? %>
|
|
27
|
+
<div id="directory" style="margin-left: 40px;">
|
|
28
|
+
<div class="title"><span class="name">Subdirectories</span></div>
|
|
29
|
+
</div>
|
|
30
|
+
<%= alpha_table(feature_subdirectories) %>
|
|
31
|
+
<% else %>
|
|
32
|
+
<!-- No Feature Directories -->
|
|
33
|
+
<% end %>
|
|
34
|
+
|
|
35
|
+
<div id="directory" style="margin-left: 40px;">
|
|
36
|
+
<div class="title"><span class="name">Step Definitions & Transforms</span></div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="steptransformers">
|
|
39
|
+
<%= step_definitions.length %>
|
|
40
|
+
<a href="<%= url_for step_transformers, "step_definitions" %>">Step Definitions</a>
|
|
41
|
+
<%= transformers.length %>
|
|
42
|
+
<a href="<%= url_for step_transformers, "step_transforms" %>">Transforms</a>
|
|
43
|
+
and <%= undefined_steps.length %>
|
|
44
|
+
<a href="<%= url_for step_transformers, "undefined_steps" %>">Undefined Steps</a>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
<% end %>
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
def init
|
|
2
|
+
super
|
|
3
|
+
sections.push :requirements
|
|
4
|
+
@namespace = object
|
|
5
|
+
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def features
|
|
9
|
+
@features ||= Registry.all(:feature)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def tags
|
|
13
|
+
@tags ||= Registry.all(:tag).sort_by {|l| l.value.to_s }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def feature_directories
|
|
17
|
+
@feature_directories ||= YARD::CodeObjects::Cucumber::CUCUMBER_NAMESPACE.children.find_all {|child| child.is_a?(YARD::CodeObjects::Cucumber::FeatureDirectory)}
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def feature_subdirectories
|
|
21
|
+
@feature_subdirectories ||= Registry.all(:featuredirectory) - feature_directories
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def step_transformers
|
|
25
|
+
YARD::CodeObjects::Cucumber::CUCUMBER_STEPTRANSFORM_NAMESPACE
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def step_definitions
|
|
29
|
+
@step_definitions ||= YARD::Registry.all(:stepdefinition)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def transformers
|
|
33
|
+
@transformers ||= YARD::Registry.all(:steptransform)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def undefined_steps
|
|
37
|
+
@undefined_steps ||= Registry.all(:step).reject {|s| s.definition || s.scenario.outline? }
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def alpha_table(objects)
|
|
42
|
+
@elements = Hash.new
|
|
43
|
+
|
|
44
|
+
objects = run_verifier(objects)
|
|
45
|
+
objects.each {|o| (@elements[o.value.to_s[0,1].upcase] ||= []) << o }
|
|
46
|
+
@elements.values.each {|v| v.sort! {|a,b| b.value.to_s <=> a.value.to_s } }
|
|
47
|
+
@elements = @elements.sort_by {|l,o| l.to_s }
|
|
48
|
+
|
|
49
|
+
@elements.each {|letter,objects| objects.sort! {|a,b| b.value.to_s <=> a.value.to_s }}
|
|
50
|
+
erb(:alpha_table)
|
|
51
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<div class="title">
|
|
2
|
+
<% if @item_type %>
|
|
3
|
+
<a class="control" id="<%= @item_type.gsub(/\s/,'') %>">[Collapse All]</a>
|
|
4
|
+
<div style="clear: right;"></div>
|
|
5
|
+
<% end %>
|
|
6
|
+
|
|
7
|
+
<% if @item_anchor_name %>
|
|
8
|
+
<a name="<%= @item_anchor_name %>">
|
|
9
|
+
<% end %>
|
|
10
|
+
<div class="name"><%= @item_title %></div>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<div class="requirements">
|
|
2
|
+
<div class="title">Step Definitions & Transforms</div>
|
|
3
|
+
|
|
4
|
+
<div class="summary">
|
|
5
|
+
<div><%= step_definitions.length %><a href="#step_definitions">Step Definitions</a></div>
|
|
6
|
+
<div><%= step_transforms.length %><a href="#step_transforms">Step Transforms</a></div>
|
|
7
|
+
<div><%= undefined_steps.length %><a href="#undefined_steps">Undefined Steps</a></div>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
def init
|
|
2
|
+
super
|
|
3
|
+
sections.push :index, :stepdefinitions, :steptransforms, :undefinedsteps
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
def step_definitions
|
|
7
|
+
@step_definitions ||= begin
|
|
8
|
+
YARD::Registry.all(:stepdefinition).sort_by {|definition| definition.steps.length * -1 }
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def step_transforms
|
|
13
|
+
@step_transforms ||= begin
|
|
14
|
+
YARD::Registry.all(:steptransform).sort_by {|definition| definition.steps.length * -1 }
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def undefined_steps
|
|
19
|
+
@undefined_steps ||= begin
|
|
20
|
+
unique_steps(Registry.all(:step).reject {|s| s.definition || s.scenario.outline? }).sort_by{|steps| steps.last.length * -1 }
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def stepdefinitions
|
|
25
|
+
@item_title = "Step Definitions"
|
|
26
|
+
@item_anchor_name = "step_definitions"
|
|
27
|
+
@item_type = "step definition"
|
|
28
|
+
@items = step_definitions
|
|
29
|
+
erb(:header) + erb(:transformers)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def steptransforms
|
|
33
|
+
@item_title = "Step Transforms"
|
|
34
|
+
@item_anchor_name = "step_transforms"
|
|
35
|
+
@item_type = "step transform"
|
|
36
|
+
@items = step_transforms
|
|
37
|
+
erb(:header) + erb(:transformers)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def undefinedsteps
|
|
41
|
+
@item_title = "Undefined Steps"
|
|
42
|
+
@item_anchor_name = "undefined_steps"
|
|
43
|
+
@item_type = nil
|
|
44
|
+
@items = undefined_steps
|
|
45
|
+
erb(:header) + erb(:undefinedsteps)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def unique_steps(steps)
|
|
50
|
+
uniq_steps = {}
|
|
51
|
+
steps.each {|s| (uniq_steps[s.value.to_s] ||= []) << s }
|
|
52
|
+
uniq_steps
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def display_comments_for(item)
|
|
56
|
+
begin
|
|
57
|
+
T('docstring').run(options.dup.merge({:object => item}))
|
|
58
|
+
rescue
|
|
59
|
+
log.warn %{An error occurred while attempting to render the comments for: #{item.location} }
|
|
60
|
+
return ""
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def link_constants(definition)
|
|
66
|
+
value = definition.literal_value.dup
|
|
67
|
+
|
|
68
|
+
definition.constants_from_value(value).each do |name|
|
|
69
|
+
constant = YARD::Registry.all(:constant).find{|c| c.name == name.to_sym }
|
|
70
|
+
value.gsub!(/\b#{name}\b/,"<a href='#{url_for(constant)}'>#{name}</a>") if constant
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
value
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def link_transformed_step(step)
|
|
78
|
+
value = step.value.dup
|
|
79
|
+
|
|
80
|
+
if step.definition
|
|
81
|
+
matches = step.value.match(step.definition.regex)
|
|
82
|
+
|
|
83
|
+
if matches
|
|
84
|
+
matches[1..-1].reverse.each_with_index do |match,index|
|
|
85
|
+
next if match == nil
|
|
86
|
+
transform = step.transforms.find {|transform| transform.regex.match(match) }
|
|
87
|
+
|
|
88
|
+
value[matches.begin((matches.size - 1) - index)..(matches.end((matches.size - 1) - index) - 1)] = transform ? "<a href='#{url_for(transform)}'>#{h(match)}</a>" : "<span class='match'>#{match}</span>"
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
value
|
|
94
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<% @items.each do |item| %>
|
|
2
|
+
|
|
3
|
+
<div class="transformer <%= @item_type.gsub(/\s/,'') %>
|
|
4
|
+
<%= "nodefinitions" if item.steps.nil? || item.steps.empty? %>
|
|
5
|
+
<%= "pending" if item.pending %>">
|
|
6
|
+
<a name="<%= anchor_for item %>"></a>
|
|
7
|
+
<div class="title">
|
|
8
|
+
<span class="pre"><%= h item.keyword %></span>
|
|
9
|
+
<span class="name"><%= item.value %></span>
|
|
10
|
+
<div style="float: right;">
|
|
11
|
+
<a href="http://rubular.com/?regex=<%= urlencode item.value %>" target="_blank">Rubular</a>
|
|
12
|
+
<%= "| PENDING" if item.pending %>
|
|
13
|
+
<%= "| UNUSED" if item.steps.nil? || item.steps.empty? %>
|
|
14
|
+
</div>
|
|
15
|
+
<div style="clear: both;"></div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="details">
|
|
19
|
+
|
|
20
|
+
<div class="meta" style="clear: right;">
|
|
21
|
+
<div class="file"><%= h item.location %></div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<!-- Comments -->
|
|
25
|
+
<div>
|
|
26
|
+
<%= display_comments_for item %>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
<!-- Source Code -->
|
|
31
|
+
<div class="method_details_list">
|
|
32
|
+
<table class="source_code">
|
|
33
|
+
<tr>
|
|
34
|
+
<td>
|
|
35
|
+
<pre class="lines"><%= "" %><%= h format_lines(item) %></pre>
|
|
36
|
+
</td>
|
|
37
|
+
<td>
|
|
38
|
+
<pre class="code"><%= "" %><%= html_syntax_highlight item.source %></pre>
|
|
39
|
+
</td>
|
|
40
|
+
</tr>
|
|
41
|
+
</table>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<!-- Matching Step Instances -->
|
|
45
|
+
<% if item.steps.length > 0 %>
|
|
46
|
+
<div class='showSteps'>
|
|
47
|
+
[<a href='#' class='toggleSteps' alt="<%= item.steps.length %> steps">Hide <%= item.steps.length %> steps</a>]
|
|
48
|
+
</div>
|
|
49
|
+
<% end %>
|
|
50
|
+
<div class="steps">
|
|
51
|
+
<% if item.steps && !item.steps.empty? %>
|
|
52
|
+
<% unique_steps(item.steps).each_with_index do |uniq_step,step_index| %>
|
|
53
|
+
<div class="step <%= (step_index + 1) % 2 == 0 ? 'even' : 'odd' %>">
|
|
54
|
+
<div>
|
|
55
|
+
<span class="predicate">
|
|
56
|
+
<%= h uniq_step.last.first.keyword %>
|
|
57
|
+
</span>
|
|
58
|
+
<span class="defined">
|
|
59
|
+
<%= link_transformed_step(uniq_step.last.first) %>
|
|
60
|
+
</span>
|
|
61
|
+
</div>
|
|
62
|
+
<% uniq_step.last.each do |step| %>
|
|
63
|
+
<a class="definition" style="clear: right;" href="<%= url_for step.scenario.feature %>"><%= h step.location %></a>
|
|
64
|
+
<% end %>
|
|
65
|
+
<div style="clear: both;"></div>
|
|
66
|
+
</div>
|
|
67
|
+
<% end %>
|
|
68
|
+
<% else %>
|
|
69
|
+
<div class="undefined">No steps were found to match this <%= @item_type %>.</div>
|
|
70
|
+
<% end%>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div style="margin: 30px 20px; border-top: 1px dotted #AAA;"></div>
|
|
76
|
+
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<% end %>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<div class="transformer">
|
|
2
|
+
<div class="steps">
|
|
3
|
+
<% if @undefined_steps && !@undefined_steps.empty? %>
|
|
4
|
+
<% @undefined_steps.each_with_index do |uniq_step,step_index| %>
|
|
5
|
+
<div class="step <%= (step_index + 1) % 2 == 0 ? 'even' : 'odd' %>">
|
|
6
|
+
<div>
|
|
7
|
+
<span class="predicate"><%= uniq_step.last.first.keyword %></span>
|
|
8
|
+
<span class="undefined">
|
|
9
|
+
<%= h uniq_step.last.first.value %>
|
|
10
|
+
</span>
|
|
11
|
+
</div>
|
|
12
|
+
<% uniq_step.last.each do |step| %>
|
|
13
|
+
<a class="definition" style="clear: right;" href="<%= url_for step.scenario.feature %>">
|
|
14
|
+
<%= h step.location %>
|
|
15
|
+
</a>
|
|
16
|
+
<% end%>
|
|
17
|
+
<div style="clear: both;"></div>
|
|
18
|
+
</div>
|
|
19
|
+
<% end %>
|
|
20
|
+
<% else %>
|
|
21
|
+
<div class="steps">
|
|
22
|
+
<div class="undefined">No undefined steps</div>
|
|
23
|
+
</div>
|
|
24
|
+
<% end%>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<% if @elements && !@elements.empty? %>
|
|
2
|
+
<% i = (@elements.length % 2 == 0 ? 1 : 0) %>
|
|
3
|
+
<table style="margin-left: 10px; width: 100%;">
|
|
4
|
+
<tr>
|
|
5
|
+
<td valign='top' width="50%">
|
|
6
|
+
<% @elements.each do |letter, objects| %>
|
|
7
|
+
<% if (i += 1) > (@elements.length / 2 + 1) %>
|
|
8
|
+
</td><td valign='top' width="50%">
|
|
9
|
+
<% i = 0 %>
|
|
10
|
+
<% end %>
|
|
11
|
+
<ul id="alpha_<%= letter %>" class="alpha">
|
|
12
|
+
<li class="letter"><%= letter %></li>
|
|
13
|
+
<ul>
|
|
14
|
+
<% objects.each do |obj| %>
|
|
15
|
+
<li>
|
|
16
|
+
<% if obj.is_a?(YARD::CodeObjects::Cucumber::Scenario) || obj.is_a?(YARD::CodeObjects::Cucumber::ScenarioOutline) %>
|
|
17
|
+
<a href="<%= url_for(obj.feature,"scenario_#{obj.path[(/.+_(\d+)$/),1]}") %>">
|
|
18
|
+
<%= h obj.value %>
|
|
19
|
+
</a>
|
|
20
|
+
<% else %>
|
|
21
|
+
<%= linkify obj, obj.value %>
|
|
22
|
+
<% end %>
|
|
23
|
+
<small>(<%= obj.file %>)</small>
|
|
24
|
+
</li>
|
|
25
|
+
<% end %>
|
|
26
|
+
</ul>
|
|
27
|
+
</ul>
|
|
28
|
+
<% end %>
|
|
29
|
+
</td>
|
|
30
|
+
</tr>
|
|
31
|
+
</table>
|
|
32
|
+
<% end %>
|