cucumber-in-the-yard 1.7.2 → 1.7.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.
Files changed (31) hide show
  1. data/History.txt +12 -0
  2. data/README.md +22 -0
  3. data/example/child_feature/child.feature +11 -0
  4. data/example/child_feature/grandchild_feature/grandchild.feature +12 -0
  5. data/example/scenario.feature +23 -13
  6. data/example/scenario_outline.feature +26 -6
  7. data/lib/city.rb +1 -1
  8. data/lib/cucumber/city_builder.rb +2 -2
  9. data/lib/templates/default/feature/html/feature.erb +24 -18
  10. data/lib/templates/default/feature/html/outline.erb +21 -6
  11. data/lib/templates/default/feature/html/pystring.erb +1 -1
  12. data/lib/templates/default/feature/html/scenario.erb +3 -2
  13. data/lib/templates/default/feature/html/steps.erb +1 -1
  14. data/lib/templates/default/feature/setup.rb +4 -0
  15. data/lib/templates/default/featuredirectory/html/setup.rb +1 -0
  16. data/lib/templates/default/featuretags/html/namespace.erb +68 -34
  17. data/lib/templates/default/featuretags/html/setup.rb +4 -3
  18. data/lib/templates/default/fulldoc/html/css/common.css +40 -25
  19. data/lib/templates/default/fulldoc/html/full_list.erb +2 -0
  20. data/lib/templates/default/fulldoc/html/js/cucumber.js +60 -32
  21. data/lib/templates/default/fulldoc/html/setup.rb +1 -1
  22. data/lib/templates/default/requirements/html/setup.rb +3 -0
  23. data/lib/templates/default/steptransformers/html/header.erb +5 -5
  24. data/lib/templates/default/steptransformers/html/transformers.erb +55 -49
  25. data/lib/templates/default/steptransformers/html/undefined_steps.erb +12 -6
  26. data/lib/templates/default/steptransformers/setup.rb +6 -0
  27. data/lib/yard/code_objects/cucumber/feature.rb +2 -2
  28. data/lib/yard/code_objects/cucumber/scenario_outline.rb +6 -1
  29. metadata +16 -10
  30. data/example/child_feature/grandchild_feature/scenario.feature +0 -52
  31. data/example/child_feature/scenario.feature +0 -57
@@ -1,13 +1,19 @@
1
1
  <div class="transformer">
2
2
  <div class="steps">
3
3
  <% if @undefined_steps && !@undefined_steps.empty? %>
4
- <% @undefined_steps.each_with_index do |step,step_index| %>
4
+ <% unique_steps(@undefined_steps).each_with_index do |uniq_step,step_index| %>
5
5
  <div class="step <%= (step_index + 1) % 2 == 0 ? 'even' : 'odd' %>">
6
- <span class="predicate"><%= step.keyword %></span>
7
- <span class="undefined">
8
- <%= h step.value %>
9
- </span>
10
- <a class="definition" href="<%= url_for step.scenario.feature %>"><%= h(step.location) %></a>
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%>
11
17
  <div style="clear: both;"></div>
12
18
  </div>
13
19
  <% end %>
@@ -26,6 +26,12 @@ def undefined_steps
26
26
  end
27
27
 
28
28
 
29
+ def unique_steps(steps)
30
+ uniq_steps = {}
31
+ steps.each {|s| (uniq_steps[s.value.to_s] ||= []) << s }
32
+ uniq_steps
33
+ end
34
+
29
35
  def link_transformed_step(step)
30
36
  value = step.value.dup
31
37
 
@@ -7,10 +7,10 @@ module YARD::CodeObjects::Cucumber
7
7
  attr_accessor :background, :comments, :description, :keyword, :scenarios, :tags, :value
8
8
 
9
9
  def initialize(namespace,name)
10
- super(namespace,name.to_s.strip)
11
- @comments = []
10
+ @comments = ""
12
11
  @scenarios = []
13
12
  @tags = []
13
+ super(namespace,name.to_s.strip)
14
14
  end
15
15
 
16
16
  end
@@ -23,6 +23,10 @@ module YARD::CodeObjects::Cucumber
23
23
  def outline?
24
24
  true
25
25
  end
26
+
27
+ def examples?
28
+ !@examples[:rows].nil?
29
+ end
26
30
 
27
31
  def example_keyword
28
32
  @examples[:keyword]
@@ -33,6 +37,7 @@ module YARD::CodeObjects::Cucumber
33
37
  end
34
38
 
35
39
  def example_data
40
+ return "" unless @examples[:rows]
36
41
  @examples[:rows][1..-1]
37
42
  end
38
43
 
@@ -58,4 +63,4 @@ module YARD::CodeObjects::Cucumber
58
63
 
59
64
  end
60
65
 
61
- end
66
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-in-the-yard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
- - 2
10
- version: 1.7.2
9
+ - 3
10
+ version: 1.7.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Franklin Webber
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-30 00:00:00 -08:00
18
+ date: 2010-12-06 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -81,8 +81,8 @@ files:
81
81
  - README.md
82
82
  - Rakefile
83
83
  - city.gemspec
84
- - example/child_feature/grandchild_feature/scenario.feature
85
- - example/child_feature/scenario.feature
84
+ - example/child_feature/child.feature
85
+ - example/child_feature/grandchild_feature/grandchild.feature
86
86
  - example/empty.feature
87
87
  - example/scenario.feature
88
88
  - example/scenario_outline.feature
@@ -162,13 +162,19 @@ post_install_message: |+
162
162
 
163
163
  (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
164
164
 
165
- Thank you for installing Cucumber-In-The-YARD 1.7.2 / 2010-11-30.
165
+ Thank you for installing Cucumber-In-The-YARD 1.7.3 / 2010-12-06.
166
166
 
167
167
  Changes:
168
168
 
169
- * Step Definition and Transform page enhancements
170
- * Step Regex links to Rubular
171
- * FIX Steps with HTML encoded characters will display correctly
169
+ * Shortcut Keys (t) for tags and (r) for features (f was taken)
170
+ * Step definitions/transforms consolidate steps for easier viewing
171
+ and when they have no steps they are colored differently
172
+ * Tag filtering supports inverse (~) of tags
173
+
174
+ * FIX Scenario Outlines without examples will not crash the parser
175
+ * FIX Features, Scenarios, and Directories should display in alphabetic order
176
+ * FIX Comments and multiline strings will display correctly
177
+ * FIX Feature comments will show
172
178
 
173
179
 
174
180
  (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
@@ -1,52 +0,0 @@
1
- @scenarios
2
- Feature: Scenario
3
- As a reader of the documentation I expect that scenario are documented correctly
4
-
5
- Background:
6
- Given this background step
7
-
8
- @first
9
- Scenario: No Step Scenario
10
-
11
- @second
12
- Scenario: Scenario With Steps
13
- Given this first step
14
- When this second step
15
- Then this third step
16
-
17
- @third @optional_parameters
18
- Scenario: Optional Parameter Step Definition
19
- # This step definition has some optional parameters
20
- Given a project
21
- And an inactive project
22
- And a project with the name 'optional', start date 10/26/2010, nicknamed 'norman'
23
-
24
- @fourth @highlight
25
- Scenario: Matched Term Highlighting
26
- Given a duck that has a bill
27
- Then I expect the duck to quack
28
-
29
- @fifth @table
30
- Scenario: Scenario With Table
31
- Given the following table:
32
- | column 1 | column 2 | column 3 |
33
- | value 1 | value 2 | value 3 |
34
-
35
- @sixth @text
36
- Scenario: Scenario With Text
37
- Given the following text:
38
- """
39
- Oh what a bother!
40
- """
41
-
42
- @seventh @comments
43
- Scenario: Scenario with comments and
44
- with multiple lines for the name
45
- # First Comment
46
- Given this first step
47
- # Second Comment
48
- And this second step
49
- # Third Comment
50
- And this third step
51
- # Comments after the last step, where do they go?
52
-
@@ -1,57 +0,0 @@
1
- @scenarios
2
- Feature: Scenario
3
- As a reader of the documentation I expect that scenario are documented correctly
4
-
5
- Background:
6
- Given this background step
7
-
8
- @first
9
- Scenario: No Step Scenario
10
-
11
- @second
12
- Scenario: Scenario With Steps
13
- Given this first step
14
- When this second step
15
- Then this third step
16
-
17
- @third @optional_parameters
18
- Scenario: Optional Parameter Step Definition
19
- # This step definition has some optional parameters
20
- Given a project
21
- And an inactive project
22
- And a project with the name 'optional', start date 10/26/2010, nicknamed 'norman'
23
-
24
- @fourth @highlight
25
- Scenario: Matched Term Highlighting
26
- Given a duck that has a bill
27
- Then I expect the duck to quack
28
-
29
- @fifth @table
30
- Scenario: Scenario With Table
31
- Given the following table:
32
- | column 1 | column 2 | column 3 |
33
- | value 1 | value 2 | value 3 |
34
-
35
- @sixth @text
36
- Scenario: Scenario With Text
37
- Given the following text:
38
- """
39
- Oh what a bother!
40
- """
41
-
42
- # Comments before the scenario
43
- @seventh @comments
44
- Scenario: Scenario with comments and a description
45
- There once was a need for information to be displayed alongside all the
46
- entities that I hoped to test
47
- # First Comment
48
- Given this first step
49
- # Second Comment
50
- And this second step
51
- # Third Comment
52
- And this third step
53
- # Comments after the last step, where do they go?
54
-
55
- Scenario: Step ending with a match with double-quotes
56
- When searching the log for the exact match of the message "Entering application."
57
- When the step definition has HTML escaped characters like: "<>&"