cucumber-in-the-yard 1.7.5 → 1.7.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,11 @@
1
+ === 1.7.6 / 2011-01-06
2
+
3
+ * Feature descriptions, multi-line strings, and comments will preserve spacing.
4
+ * Feature Directories now support a README.md file that can be used to provide
5
+ information (with markdown support) about the directory of features.
6
+
1
7
  === 1.7.5 / 2010-12-14
2
8
 
3
- * Ruby 1.9.2 Support
4
9
  * FIX Step Transforms were colliding with Step Definitions in Ruby 1.9.2
5
10
 
6
11
  === 1.7.4 / 2010-12-11
data/README.md CHANGED
@@ -36,6 +36,7 @@ The implemented example has been deployed at [http://recursivegames.com/cukes/](
36
36
 
37
37
  **8. [Undefined steps](http://recursivegames.com/cukes/requirements/step_transformers.html#undefined_steps) and even [Rubular](http://rubular.com/) links of your step definitions.**
38
38
 
39
+ **9. Feature directories with a README.md will be parsed into the description** [example](http://recursivegames.com/cukes/requirements/example/child_feature.html)
39
40
 
40
41
  Installation
41
42
  ------------
@@ -57,7 +57,7 @@ Gem::Specification.new do |s|
57
57
 
58
58
  s.add_dependency 'gherkin', '>= 2.2.9'
59
59
  s.add_dependency 'cucumber', '>= 0.7.5'
60
- s.add_dependency 'yard', '>= 0.6.2'
60
+ s.add_dependency 'yard', '>= 0.6.3'
61
61
 
62
62
  s.rubygems_version = "1.3.7"
63
63
  s.files = `git ls-files`.split("\n")
@@ -0,0 +1,19 @@
1
+ Feature Directory README
2
+ ========================
3
+
4
+ Synopsis
5
+ --------
6
+
7
+ This collection of features are contained in this folder. The description README
8
+ allows a user to place a description for entire directory of the features and appears
9
+ in the output to assist with understanding about the collection of features.
10
+
11
+ Resources
12
+ ---------
13
+
14
+ Links to particular resources like the links to the stories, tasks, or other areas
15
+ can also be represented.
16
+
17
+ The implemented example has been deployed at [http://recursivegames.com/cukes/](http://recursivegames.com/cukes/).
18
+
19
+ **1. An Item** [example](http://recursivegames.com/cukes/requirements/)
@@ -38,8 +38,10 @@ Feature: Displaying Scenarios
38
38
  Scenario: Scenario With Text
39
39
  Given the following text:
40
40
  """
41
- Oh what a bother!
42
- That this text has to take up two lines
41
+ Oh what a bother!
42
+ That this text has to take up two lines
43
+ This line should be indented 2 spaces
44
+ This line should be idented 4 spaces
43
45
  """
44
46
 
45
47
  # Comments before the scenario
@@ -0,0 +1,18 @@
1
+ @tags
2
+ Feature: Tags
3
+ As a developer of the test suite I expect that various tags will be supported
4
+
5
+ @tag
6
+ Scenario: Basic Tag
7
+
8
+ @tag123456
9
+ Scenario: Tag With Numbers
10
+
11
+ @tag_with_underscore
12
+ Scenario: Tag With Underscore
13
+
14
+ @tag-with-dash
15
+ Scenario: Tag With Dash
16
+
17
+ @tag+with+plus
18
+ Scenario: Tag With Plus
@@ -4,7 +4,7 @@ require 'gherkin/formatter/tag_count_formatter'
4
4
 
5
5
 
6
6
  module CucumberInTheYARD
7
- VERSION = '1.7.5' unless defined?(CucumberInTheYARD::VERSION)
7
+ VERSION = '1.7.6' unless defined?(CucumberInTheYARD::VERSION)
8
8
  end
9
9
 
10
10
  require File.dirname(__FILE__) + "/yard/code_objects/cucumber/base.rb"
@@ -15,15 +15,21 @@ module Cucumber
15
15
  end
16
16
 
17
17
  def find_or_create_namespace(file)
18
- file.split('/')[0..-2].each do |directory|
19
- @namespace = @namespace.children.find {|child| child.name == directory } ||
20
- YARD::CodeObjects::Cucumber::FeatureDirectory.new(@namespace,directory) {|dir| dir.add_file(directory)}
18
+ @namespace = YARD::CodeObjects::Cucumber::CUCUMBER_NAMESPACE
19
+
20
+ File.dirname(file).split('/').each do |directory|
21
+ @namespace = @namespace.children.find {|child| child.is_a?(YARD::CodeObjects::Cucumber::FeatureDirectory) && child.name.to_s == directory } ||
22
+ @namespace = YARD::CodeObjects::Cucumber::FeatureDirectory.new(@namespace,directory) {|dir| dir.add_file(directory)}
23
+ end
24
+
25
+ if @namespace.description == "" && File.exists?("#{File.dirname(file)}/README.md")
26
+ @namespace.description = File.read("#{File.dirname(file)}/README.md")
21
27
  end
22
28
  end
23
29
 
24
30
  def find_or_create_tag(tag_name,parent)
25
31
  #log.debug "Processing tag #{tag_name}"
26
- tag_code_object = YARD::Registry.all(:tag).find {|tag| tag.value == tag_name } ||
32
+ tag_code_object = YARD::Registry.all(:tag).find {|tag| tag.value == tag_name } ||
27
33
  YARD::CodeObjects::Cucumber::Tag.new(YARD::CodeObjects::Cucumber::CUCUMBER_TAG_NAMESPACE,tag_name.gsub('@','')) {|t| t.owners = [] ; t.value = tag_name }
28
34
 
29
35
  tag_code_object.add_file(@file,parent.line)
@@ -1,3 +1,3 @@
1
1
  <div class="text">
2
- <%= htmlify_with_newlines @step.text %>
2
+ <%= htmlify_with_newlines @step.text %>
3
3
  </div>
@@ -51,5 +51,5 @@ def highlight_matches(step)
51
51
  end
52
52
 
53
53
  def htmlify_with_newlines(text)
54
- text.split("\n").collect {|c| h(c) }.join("<br/>")
54
+ text.split("\n").collect {|c| h(c).gsub(/\s/,'&nbsp;') }.join("<br/>")
55
55
  end
@@ -14,31 +14,13 @@
14
14
  <div class="tags"><span class="name">Tags:</span>
15
15
  <%= tags.collect {|tag| linkify(tag,tag.value) }.join(",\n") %>
16
16
  </div>
17
+ </div>
17
18
 
19
+ <div class="readme">
20
+ <%= markdown @directory.description %>
21
+ </div>
18
22
 
19
- <% if @directories_by_letter && !@directories_by_letter.empty? %>
20
- <div id="directory">
21
- <div class="title"><span class="name">Subdirectories</span></div>
22
- </div>
23
- <% i = 0 %>
24
- <table>
25
- <tr>
26
- <td valign='top' width="33%">
27
- <% @directories_by_letter.each do |directory| %>
28
- <% if (i += 1) % 8 == 0 %>
29
- </td><td valign='top' width="33%">
30
- <% i = 0 %>
31
- <% end %>
32
- <ul>
33
- <%= linkify directory, directory.name %>
34
- </ul>
35
- <% end %>
36
- </td>
37
- </tr>
38
- </table>
39
-
40
- <% end %>
41
-
23
+ <div>
42
24
  <% if @objects_by_letter && !@objects_by_letter.empty? %>
43
25
  <div id="features">
44
26
  <div class="title"><span class="name">Features</span></div>
@@ -72,5 +54,28 @@
72
54
  <% end %>
73
55
  <% end %>
74
56
 
57
+ <% if @directories_by_letter && !@directories_by_letter.empty? %>
58
+ <div id="directory">
59
+ <div class="title"><span class="name">Subdirectories</span></div>
60
+ </div>
61
+ <% i = 0 %>
62
+ <table>
63
+ <tr>
64
+ <td valign='top' width="33%">
65
+ <% @directories_by_letter.each do |directory| %>
66
+ <% if (i += 1) % 8 == 0 %>
67
+ </td><td valign='top' width="33%">
68
+ <% i = 0 %>
69
+ <% end %>
70
+ <ul>
71
+ <%= linkify directory, directory.name %>
72
+ </ul>
73
+ <% end %>
74
+ </td>
75
+ </tr>
76
+ </table>
77
+
78
+ <% end %>
79
+
75
80
  </div>
76
81
 
@@ -4,6 +4,10 @@ def init
4
4
  @directory = object
5
5
  end
6
6
 
7
+ def markdown(text)
8
+ h(text,:markdown) rescue h(text)
9
+ end
10
+
7
11
  def directory
8
12
  @objects_by_letter = all_types_by_letter(YARD::CodeObjects::Cucumber::Feature)
9
13
  @directories_by_letter = @directory.children.find_all {|child| child.is_a?(YARD::CodeObjects::Cucumber::FeatureDirectory) }.sort_by {|dir| dir.name.to_s }
@@ -35,3 +39,6 @@ def tags
35
39
  (features.collect{|feature| feature.tags } + scenarios.collect {|scenario| scenario.tags }).flatten.uniq
36
40
  end
37
41
 
42
+ def htmlify_with_newlines(text)
43
+ text.split("\n").collect {|c| h(c).gsub(/\s/,'&nbsp;') }.join("<br/>")
44
+ end
@@ -20,6 +20,7 @@
20
20
 
21
21
  .suggestion { color: #ff686e; }
22
22
 
23
+ .readme { margin: 0px 10px 0px 30px; padding: 0px; }
23
24
 
24
25
  .feature .description, .requirements .summary {
25
26
  margin: 10px 20px 0px 30px;
@@ -66,12 +67,11 @@
66
67
  .scenario .tags { float: right; margin-right: 20px; margin-top: 5px; }
67
68
 
68
69
 
69
- * ul.alpha { padding-left: 50px; font-size: 1.1em; }
70
+ * ul.alpha { font-size: 1.1em; }
70
71
  * ul.alpha { padding-bottom: 10px; list-style: none; }
71
72
  * ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; }
72
- * ul.alpha ul { padding-left: 5px; }
73
+ * ul.alpha ul { padding-left: 15px; }
73
74
  * ul small { color: #666; font-size: 0.7em; }
74
- * ul.alpha ul li { list-style: none; padding-left: 0px;}
75
75
 
76
76
 
77
77
  .scenario .steps {
@@ -9,7 +9,20 @@
9
9
 
10
10
  <div class="requirements">
11
11
 
12
+ <div class="summary">
13
+ <span class="name">Features:</span><span class="value"><%= features.size %></span>
14
+ <span class="name">Scenarios:</span><span class="value"><%= scenarios.size %></span>
15
+ <span class="name">Steps:</span><span class="value"><%= steps.size %></span>
16
+ <span class="name">Tags:</span><span class="value"><%= tags.size %></span>
17
+ </div>
18
+ <div class="tags"><span class="name">Tags:</span>
19
+ <%= tags.collect {|tag| linkify(tag,tag.value) }.join(",\n") %>
20
+ </div>
21
+
12
22
  <% if features && !features.empty? %>
23
+ <div id="features" style="margin-left: 40px;">
24
+ <div class="title"><span class="name">Features</span></div>
25
+ </div>
13
26
  <% i = 0 %>
14
27
  <table style="margin-left: 10px;">
15
28
  <tr>
@@ -11,7 +11,14 @@ module YARD::CodeObjects::Cucumber
11
11
  class StepTransformersObject < NamespaceObject ; end
12
12
 
13
13
  class FeatureDirectory < YARD::CodeObjects::NamespaceObject
14
-
14
+
15
+ attr_accessor :description
16
+
17
+ def initialize(namespace,name)
18
+ super(namespace,name)
19
+ @description = ""
20
+ end
21
+
15
22
  def location
16
23
  files.first.first if files && !files.empty?
17
24
  end
@@ -9,6 +9,8 @@ module YARD::Templates::Helpers
9
9
  "Step Definitions and Transforms"
10
10
  elsif object.is_a?(YARD::CodeObjects::Cucumber::NamespaceObject)
11
11
  "#{format_object_type(object)}#{object.value ? ": #{object.value}" : ''}"
12
+ elsif object.is_a?(YARD::CodeObjects::Cucumber::FeatureDirectory)
13
+ "Feature Directory: #{object.name}"
12
14
  else
13
15
  case object
14
16
  when YARD::CodeObjects::RootObject
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-in-the-yard
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 7
4
5
  prerelease: false
5
6
  segments:
6
7
  - 1
7
8
  - 7
8
- - 5
9
- version: 1.7.5
9
+ - 6
10
+ version: 1.7.6
10
11
  platform: ruby
11
12
  authors:
12
13
  - Franklin Webber
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-12-16 00:00:00 -08:00
18
+ date: 2011-01-06 00:00:00 -08:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
@@ -25,6 +26,7 @@ dependencies:
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 21
28
30
  segments:
29
31
  - 2
30
32
  - 2
@@ -40,6 +42,7 @@ dependencies:
40
42
  requirements:
41
43
  - - ">="
42
44
  - !ruby/object:Gem::Version
45
+ hash: 9
43
46
  segments:
44
47
  - 0
45
48
  - 7
@@ -55,11 +58,12 @@ dependencies:
55
58
  requirements:
56
59
  - - ">="
57
60
  - !ruby/object:Gem::Version
61
+ hash: 1
58
62
  segments:
59
63
  - 0
60
64
  - 6
61
- - 2
62
- version: 0.6.2
65
+ - 3
66
+ version: 0.6.3
63
67
  type: :runtime
64
68
  version_requirements: *id003
65
69
  description: " \n Cucumber-In-The-Yard is a YARD extension that processes Cucumber Features, Scenarios, Steps,\n Step Definitions, Transforms, and Tags and provides a documentation interface that allows you\n easily view and investigate the test suite. This tools hopes to bridge the gap of being able\n to provide your feature descriptions to your Product Owners and Stakeholders. "
@@ -77,6 +81,7 @@ files:
77
81
  - README.md
78
82
  - Rakefile
79
83
  - city.gemspec
84
+ - example/child_feature/README.md
80
85
  - example/child_feature/child.feature
81
86
  - example/child_feature/grandchild_feature/grandchild.feature
82
87
  - example/empty.feature
@@ -87,6 +92,7 @@ files:
87
92
  - example/step_definitions/support/env.rb
88
93
  - example/step_definitions/support/env_support.rb
89
94
  - example/step_definitions/support/support.rb
95
+ - example/tags.feature
90
96
  - example/transform.feature
91
97
  - lib/city.rb
92
98
  - lib/cucumber/city_builder.rb
@@ -120,8 +126,6 @@ files:
120
126
  - lib/templates/default/layout/html/search.erb
121
127
  - lib/templates/default/requirements/html/namespace.erb
122
128
  - lib/templates/default/requirements/html/setup.rb
123
- - lib/templates/default/scenario/html/scenario.erb
124
- - lib/templates/default/scenario/setup.rb
125
129
  - lib/templates/default/steptransformers/html/header.erb
126
130
  - lib/templates/default/steptransformers/html/transformers.erb
127
131
  - lib/templates/default/steptransformers/html/undefined_steps.erb
@@ -157,9 +161,21 @@ has_rdoc: true
157
161
  homepage: http://github.com/burtlo/Cucumber-In-The-Yard
158
162
  licenses: []
159
163
 
160
- post_install_message: "\n\
161
- (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n Thank you for installing Cucumber-In-The-YARD 1.7.5 / 2010-12-14.\n \n Changes:\n \n * Ruby 1.9.2 Support\n * FIX Step Transforms were colliding with Step Definitions in Ruby 1.9.2\n \n\n\
162
- (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n"
164
+ post_install_message: |+
165
+
166
+ (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
167
+
168
+ Thank you for installing Cucumber-In-The-YARD 1.7.6 / 2011-01-06.
169
+
170
+ Changes:
171
+
172
+ * Feature descriptions, multi-line strings, and comments will preserve spacing.
173
+ * Feature Directories now support a README.md file that can be used to provide
174
+ information (with markdown support) about the directory of features.
175
+
176
+
177
+ (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
178
+
163
179
  rdoc_options:
164
180
  - --charset=UTF-8
165
181
  require_paths:
@@ -169,6 +185,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
169
185
  requirements:
170
186
  - - ">="
171
187
  - !ruby/object:Gem::Version
188
+ hash: 3
172
189
  segments:
173
190
  - 0
174
191
  version: "0"
@@ -177,6 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
194
  requirements:
178
195
  - - ">="
179
196
  - !ruby/object:Gem::Version
197
+ hash: 3
180
198
  segments:
181
199
  - 0
182
200
  version: "0"
@@ -1,23 +0,0 @@
1
- <div class="scenario">
2
- <div class="title">
3
- <span class="pre">Scenario:</span>
4
- <span class="name"><%= @scenario.value %></span>
5
- </div>
6
- <% unless @scenario.tags.empty? %>
7
- <div class="tags"><%= @scenario.tags.collect { |tags| tags.value }.join("&nbsp;&nbsp;") %></div>
8
- <% end %>
9
- <% unless @scenario.description.empty? %>
10
- <div class="description">
11
- <%= @scenario.description.join("\n<br/>") %>
12
- </div>
13
- <% end %>
14
- <div class="steps">
15
- <% unless @scenario.steps.empty? %>
16
- <% @scenario.steps.each do |step| %>
17
- <div class="step"><span class="predicate"><%= step.keyword %></span>&nbsp;<%= step.line %></div>
18
- <% end %>
19
- <% else %>
20
- <span>No Steps Defined</span>
21
- <% end %>
22
- </div>
23
- </div>
@@ -1,5 +0,0 @@
1
- def init
2
- super
3
- sections.push :scenario
4
- @scenario = object
5
- end