cucumber-in-the-yard 1.3 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +24 -0
- data/Manifest +54 -41
- data/README.md +45 -1
- data/Rakefile +4 -3
- data/cucumber-in-the-yard.gemspec +5 -5
- data/example/{example.step.rb → step_definitions/example.step.rb} +0 -0
- data/example/step_definitions/support/env.rb +0 -0
- data/example/step_definitions/support/env_support.rb +0 -0
- data/example/step_definitions/support/support.rb +0 -0
- data/features/definitions/city_step.rb +89 -0
- data/features/definitions/test.setup.and.teardown.rb +27 -0
- data/features/features.feature +44 -0
- data/lib/city.rb +20 -11
- data/lib/cucumber/city_builder.rb +60 -55
- data/lib/templates/default/feature/html/background.erb +92 -0
- data/lib/templates/default/feature/html/feature.erb +22 -0
- data/lib/templates/default/feature/html/no_steps_defined.erb +1 -0
- data/lib/templates/default/feature/html/outline.erb +19 -0
- data/lib/templates/default/feature/html/pystring.erb +3 -0
- data/lib/templates/default/feature/html/scenario.erb +43 -0
- data/lib/templates/default/feature/html/steps.erb +34 -0
- data/lib/templates/default/feature/html/table.erb +20 -0
- data/lib/templates/default/feature/setup.rb +28 -0
- data/lib/{yard/templates → templates}/default/fulldoc/html/css/common.css +0 -0
- data/lib/{yard/templates → templates}/default/fulldoc/html/full_list.erb +0 -0
- data/lib/templates/default/fulldoc/html/full_list_features.erb +7 -0
- data/lib/templates/default/fulldoc/html/full_list_requirements.erb +1 -0
- data/lib/templates/default/fulldoc/html/full_list_scenarios.erb +8 -0
- data/lib/{yard/templates → templates}/default/fulldoc/html/full_list_stepdefinitions.erb +2 -2
- data/lib/{yard/templates → templates}/default/fulldoc/html/full_list_steps.erb +0 -0
- data/lib/templates/default/fulldoc/html/full_list_tags.erb +8 -0
- data/lib/{yard/templates → templates}/default/fulldoc/html/index.erb +0 -0
- data/lib/{yard/templates → templates}/default/fulldoc/html/js/cucumber.js +1 -1
- data/lib/templates/default/fulldoc/html/setup.rb +56 -0
- data/lib/{yard/templates → templates}/default/layout/html/headers.erb +0 -0
- data/lib/{yard/templates → templates}/default/layout/html/search.erb +0 -0
- data/lib/{yard/templates → templates}/default/scenario/html/scenario.erb +0 -0
- data/lib/{yard/templates → templates}/default/scenario/setup.rb +0 -0
- data/lib/templates/default/steptransformers/html/stepdefinition.erb +38 -0
- data/lib/templates/default/steptransformers/html/steptransformers.erb +7 -0
- data/lib/templates/default/steptransformers/setup.rb +17 -0
- data/lib/templates/default/tag/html/feature.erb +23 -0
- data/lib/templates/default/tag/html/scenario.erb +21 -0
- data/lib/templates/default/tag/html/tag.erb +18 -0
- data/lib/templates/default/tag/setup.rb +5 -0
- data/lib/yard/code_objects/{base.rb → cucumber/base.rb} +3 -9
- data/lib/yard/code_objects/{feature.rb → cucumber/feature.rb} +1 -1
- data/lib/yard/code_objects/cucumber/namespace_object.rb +18 -0
- data/lib/yard/code_objects/{scenario.rb → cucumber/scenario.rb} +1 -1
- data/lib/yard/code_objects/{step.rb → cucumber/step.rb} +0 -0
- data/lib/yard/code_objects/cucumber/tag.rb +27 -0
- data/lib/yard/{extensions.rb → code_objects/namespace_object.rb} +11 -2
- data/lib/yard/code_objects/step_definition.rb +38 -0
- data/lib/yard/code_objects/step_transform.rb +14 -0
- data/lib/yard/handlers/{base.rb → cucumber/base.rb} +0 -0
- data/lib/yard/handlers/{feature_handler.rb → cucumber/feature_handler.rb} +3 -2
- data/lib/yard/handlers/step_definition_handler.rb +57 -0
- data/lib/yard/handlers/step_transform_handler.rb +21 -0
- data/lib/yard/parser/{feature.rb → cucumber/feature.rb} +0 -0
- data/lib/yard/parser/source_parser.rb +54 -0
- data/lib/yard/rake/city_task.rb +1 -1
- data/lib/yard/templates/helpers/base_helper.rb +20 -0
- metadata +105 -77
- data/lib/yard/code_objects/tags.rb +0 -55
- data/lib/yard/rb_extensions.rb +0 -156
- data/lib/yard/templates/default/feature/html/feature.erb +0 -245
- data/lib/yard/templates/default/feature/setup.rb +0 -5
- data/lib/yard/templates/default/fulldoc/html/full_list_features.erb +0 -10
- data/lib/yard/templates/default/fulldoc/html/full_list_scenarios.erb +0 -10
- data/lib/yard/templates/default/fulldoc/html/full_list_tagusages.erb +0 -10
- data/lib/yard/templates/default/fulldoc/html/setup.rb +0 -73
- data/lib/yard/templates/default/module/html/step_transforms.erb +0 -23
- data/lib/yard/templates/default/module/setup.rb +0 -5
- data/lib/yard/templates/default/steptransformers/html/stepdefinition.erb +0 -50
- data/lib/yard/templates/default/steptransformers/setup.rb +0 -5
- data/lib/yard/templates/default/tagusage/html/tagusage.erb +0 -65
- data/lib/yard/templates/default/tagusage/setup.rb +0 -5
- data/spec/city/feature_parser_spec_examples.rb +0 -153
- data/spec/city/gherkin_loader_spec.rb +0 -39
- data/spec/city/test.feature +0 -36
- data/spec/city/yard_handlers_cucumber_spec.rb +0 -24
- data/spec/city/yard_namespace_object_spec.rb +0 -8
- data/spec/city/yard_parser_cucumber_spec.rb +0 -215
- data/spec/city/yard_rb_extensions_spec.rb +0 -128
- data/spec/spec_helper.rb +0 -5
data/History.txt
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
=== 1.4 / 2010-10-17
|
2
|
+
|
3
|
+
* Tagusage has been retired
|
4
|
+
* Tags are found during parsing by name or created and all uses are appended to the exising or newly created object
|
5
|
+
* Tagusage template renamed and fixed up for just a tag and all the references
|
6
|
+
* Tags are named tag_TAG (removed the @ as it was encoded during file serialization and I couldn't find an encoder helper)
|
7
|
+
* Cleaned up all references in the fulldoc, full list to references tags
|
8
|
+
|
9
|
+
* Moved Cucumber CodeObjects, Handlers, and Parsers to a Cucumber sub-directory
|
10
|
+
* Moved StepDefinition and StepTransforms form extensions.rb to individual StepObject and Handlers files
|
11
|
+
|
12
|
+
* (lsegal advice) Created Cucumber Namespace and sub namespaces for features, tags, and step transformers.
|
13
|
+
* (lsegal advice) Started to break apart the feature.erb into smaller digestable erb sections
|
14
|
+
|
15
|
+
* Feature namespace now parallels the directory structure of the feature directory (from where it is parsed)
|
16
|
+
* Feature files have simpler names; i.e. featurefile.html instead of featurefile.feature.html
|
17
|
+
* Feature page title now states Feature: The Feature ( KEYWORD: FEATURE_TITLE )
|
18
|
+
* Moved the templates to lib/templates so I could use yard/templates to override the YARD helpers
|
19
|
+
|
20
|
+
* Changed document parsing to mirror the order imposed by Cucumber, this is to stop features being loaded before step definitions.
|
21
|
+
This should hopefully address the issue where steps were not being mapped correctly to step definitions. This fixed the issue
|
22
|
+
in the small and large test suite I ran it against.
|
23
|
+
|
24
|
+
|
1
25
|
=== 1.3 / 2010-10-13
|
2
26
|
|
3
27
|
* (7rans requested) Step definitions to show their source code; required a better source definition to be stored during creation of the CodeObject
|
data/Manifest
CHANGED
@@ -4,49 +4,62 @@ README.md
|
|
4
4
|
Rakefile
|
5
5
|
example/empty.feature
|
6
6
|
example/example.feature
|
7
|
-
example/example.step.rb
|
8
7
|
example/example.third.feature
|
9
8
|
example/second_example.feature
|
9
|
+
example/step_definitions/example.step.rb
|
10
|
+
example/step_definitions/support/env.rb
|
11
|
+
example/step_definitions/support/env_support.rb
|
12
|
+
example/step_definitions/support/support.rb
|
13
|
+
features/definitions/city_step.rb
|
14
|
+
features/definitions/test.setup.and.teardown.rb
|
15
|
+
features/features.feature
|
10
16
|
lib/city.rb
|
11
17
|
lib/cucumber/city_builder.rb
|
12
|
-
lib/
|
13
|
-
lib/
|
14
|
-
lib/
|
15
|
-
lib/
|
16
|
-
lib/
|
17
|
-
lib/
|
18
|
-
lib/
|
19
|
-
lib/
|
20
|
-
lib/
|
18
|
+
lib/templates/default/feature/html/background.erb
|
19
|
+
lib/templates/default/feature/html/feature.erb
|
20
|
+
lib/templates/default/feature/html/no_steps_defined.erb
|
21
|
+
lib/templates/default/feature/html/outline.erb
|
22
|
+
lib/templates/default/feature/html/pystring.erb
|
23
|
+
lib/templates/default/feature/html/scenario.erb
|
24
|
+
lib/templates/default/feature/html/steps.erb
|
25
|
+
lib/templates/default/feature/html/table.erb
|
26
|
+
lib/templates/default/feature/setup.rb
|
27
|
+
lib/templates/default/fulldoc/html/css/common.css
|
28
|
+
lib/templates/default/fulldoc/html/full_list.erb
|
29
|
+
lib/templates/default/fulldoc/html/full_list_features.erb
|
30
|
+
lib/templates/default/fulldoc/html/full_list_requirements.erb
|
31
|
+
lib/templates/default/fulldoc/html/full_list_scenarios.erb
|
32
|
+
lib/templates/default/fulldoc/html/full_list_stepdefinitions.erb
|
33
|
+
lib/templates/default/fulldoc/html/full_list_steps.erb
|
34
|
+
lib/templates/default/fulldoc/html/full_list_tags.erb
|
35
|
+
lib/templates/default/fulldoc/html/index.erb
|
36
|
+
lib/templates/default/fulldoc/html/js/cucumber.js
|
37
|
+
lib/templates/default/fulldoc/html/setup.rb
|
38
|
+
lib/templates/default/layout/html/headers.erb
|
39
|
+
lib/templates/default/layout/html/search.erb
|
40
|
+
lib/templates/default/scenario/html/scenario.erb
|
41
|
+
lib/templates/default/scenario/setup.rb
|
42
|
+
lib/templates/default/steptransformers/html/stepdefinition.erb
|
43
|
+
lib/templates/default/steptransformers/html/steptransformers.erb
|
44
|
+
lib/templates/default/steptransformers/setup.rb
|
45
|
+
lib/templates/default/tag/html/feature.erb
|
46
|
+
lib/templates/default/tag/html/scenario.erb
|
47
|
+
lib/templates/default/tag/html/tag.erb
|
48
|
+
lib/templates/default/tag/setup.rb
|
49
|
+
lib/yard/code_objects/cucumber/base.rb
|
50
|
+
lib/yard/code_objects/cucumber/feature.rb
|
51
|
+
lib/yard/code_objects/cucumber/namespace_object.rb
|
52
|
+
lib/yard/code_objects/cucumber/scenario.rb
|
53
|
+
lib/yard/code_objects/cucumber/step.rb
|
54
|
+
lib/yard/code_objects/cucumber/tag.rb
|
55
|
+
lib/yard/code_objects/namespace_object.rb
|
56
|
+
lib/yard/code_objects/step_definition.rb
|
57
|
+
lib/yard/code_objects/step_transform.rb
|
58
|
+
lib/yard/handlers/cucumber/base.rb
|
59
|
+
lib/yard/handlers/cucumber/feature_handler.rb
|
60
|
+
lib/yard/handlers/step_definition_handler.rb
|
61
|
+
lib/yard/handlers/step_transform_handler.rb
|
62
|
+
lib/yard/parser/cucumber/feature.rb
|
63
|
+
lib/yard/parser/source_parser.rb
|
21
64
|
lib/yard/rake/city_task.rb
|
22
|
-
lib/yard/
|
23
|
-
lib/yard/templates/default/feature/html/feature.erb
|
24
|
-
lib/yard/templates/default/feature/setup.rb
|
25
|
-
lib/yard/templates/default/fulldoc/html/css/common.css
|
26
|
-
lib/yard/templates/default/fulldoc/html/full_list.erb
|
27
|
-
lib/yard/templates/default/fulldoc/html/full_list_features.erb
|
28
|
-
lib/yard/templates/default/fulldoc/html/full_list_scenarios.erb
|
29
|
-
lib/yard/templates/default/fulldoc/html/full_list_stepdefinitions.erb
|
30
|
-
lib/yard/templates/default/fulldoc/html/full_list_steps.erb
|
31
|
-
lib/yard/templates/default/fulldoc/html/full_list_tagusages.erb
|
32
|
-
lib/yard/templates/default/fulldoc/html/index.erb
|
33
|
-
lib/yard/templates/default/fulldoc/html/js/cucumber.js
|
34
|
-
lib/yard/templates/default/fulldoc/html/setup.rb
|
35
|
-
lib/yard/templates/default/layout/html/headers.erb
|
36
|
-
lib/yard/templates/default/layout/html/search.erb
|
37
|
-
lib/yard/templates/default/module/html/step_transforms.erb
|
38
|
-
lib/yard/templates/default/module/setup.rb
|
39
|
-
lib/yard/templates/default/scenario/html/scenario.erb
|
40
|
-
lib/yard/templates/default/scenario/setup.rb
|
41
|
-
lib/yard/templates/default/steptransformers/html/stepdefinition.erb
|
42
|
-
lib/yard/templates/default/steptransformers/setup.rb
|
43
|
-
lib/yard/templates/default/tagusage/html/tagusage.erb
|
44
|
-
lib/yard/templates/default/tagusage/setup.rb
|
45
|
-
spec/city/feature_parser_spec_examples.rb
|
46
|
-
spec/city/gherkin_loader_spec.rb
|
47
|
-
spec/city/test.feature
|
48
|
-
spec/city/yard_handlers_cucumber_spec.rb
|
49
|
-
spec/city/yard_namespace_object_spec.rb
|
50
|
-
spec/city/yard_parser_cucumber_spec.rb
|
51
|
-
spec/city/yard_rb_extensions_spec.rb
|
52
|
-
spec/spec_helper.rb
|
65
|
+
lib/yard/templates/helpers/base_helper.rb
|
data/README.md
CHANGED
@@ -19,6 +19,8 @@ An example, particularly the example features included with the project, of CITY
|
|
19
19
|
**1. Users are able to search by Feature, Tags, and Scenario.**
|
20
20
|
|
21
21
|
Appended to the traditional search areas is the ability to now search by Feature, Tag, and Scenario.
|
22
|
+
The user is able to search by steps, though I have not placed those links on the page, in step_list.html
|
23
|
+
found in the root of the output directory.
|
22
24
|
|
23
25
|
**2. Feature pages are displayed in a decently formatted HTML representation**
|
24
26
|
|
@@ -32,7 +34,7 @@ Providing quick access to the important tag divisions that have been created in
|
|
32
34
|
On the top of the page there are some quick calculations of the number of features and scenarios that
|
33
35
|
share the specified tag.
|
34
36
|
|
35
|
-
**4. Steps link to Step definitions. Step definitions show all uses
|
37
|
+
**4. Steps link to Step definitions. Step definitions show all uses.**
|
36
38
|
|
37
39
|
Step definitions are displayed in their own index page and for each step definition a list of implemented
|
38
40
|
steps for this step definition. This is useful for providing example documentation and quickly understanding
|
@@ -108,6 +110,48 @@ scale to test the functionality of small software component. Though, ultimately
|
|
108
110
|
functionality may provide a valuable tool for many as I feel it helps more solidly bridge the reporting of
|
109
111
|
the documentation by putting a coat of paint on it.
|
110
112
|
|
113
|
+
Roadmap
|
114
|
+
-------
|
115
|
+
|
116
|
+
**Version 1**
|
117
|
+
|
118
|
+
Current feature set is all that I had planned for this first release.
|
119
|
+
|
120
|
+
**1. Users are able to search by Feature, Tags, and Scenario.**
|
121
|
+
**2. Feature pages are displayed in a decently formatted HTML representation**
|
122
|
+
**3. Tag pages display all the Features and scenarios that currently employ the tag.**
|
123
|
+
**4. Steps link to Step definitions. Step definitions show all uses.**
|
124
|
+
|
125
|
+
Subsequent updates are fixes or enhancements to the fundamental structure behind the scenes. Lsegal,
|
126
|
+
has been extremely helpful in assisting me with the re-organization and refinement of this first release.
|
127
|
+
|
128
|
+
**Future Feature Ideas**
|
129
|
+
|
130
|
+
**1. Users are able to search Features, Scenarios, and Tags in a unified search box.**
|
131
|
+
|
132
|
+
I want to rid the three added search fields and provide one unified search field that will use YARD's
|
133
|
+
namespace structure (similar to how Class List works).
|
134
|
+
|
135
|
+
**2. Tag pages provide the ability to exclude other tags that intersect.**
|
136
|
+
|
137
|
+
Adding a list of tags currently used by the features and scenarios in the below list (that are not the
|
138
|
+
current tag). Allowing the visualization of what the execution of the requirements pass would look like.
|
139
|
+
Output of a sample generated tag command-line would be displayed to assist with execution. On selection
|
140
|
+
update of the total features and scenarios affected by the changes in the filtering.
|
141
|
+
|
142
|
+
I would like to also address some layout and formatting on the page. Scenarios will also link to the scenarios
|
143
|
+
feature page, show their descriptions, and of course all their other tags.
|
144
|
+
|
145
|
+
**3. Step Trasnforms would be displayed where they are used**
|
146
|
+
|
147
|
+
These tricky pieces of code tend to trip me up and others on the project. I want to be able to show which steps
|
148
|
+
that have mapped to step definitions are being affected by step transforms.
|
149
|
+
|
150
|
+
**4. Highlight the sections of steps that match in the step definition**
|
151
|
+
|
152
|
+
Similar to the great output that Cucumber uses to show what is the variable part of the step definition, I would like
|
153
|
+
to have the steps displayed differently to illustrate that they are the variable in the statement.
|
154
|
+
|
111
155
|
|
112
156
|
LICENSE
|
113
157
|
-------
|
data/Rakefile
CHANGED
@@ -4,11 +4,12 @@ require 'echoe'
|
|
4
4
|
task :default => :gendoc
|
5
5
|
|
6
6
|
task :gendoc do
|
7
|
-
`
|
7
|
+
`rm -rf doc`
|
8
|
+
`yardoc -e lib/city.rb -p lib/templates 'example/**/*' --debug`
|
8
9
|
end
|
9
10
|
|
10
|
-
Echoe.new('cucumber-in-the-yard', '1.
|
11
|
-
g.author = "
|
11
|
+
Echoe.new('cucumber-in-the-yard', '1.4') do |g|
|
12
|
+
g.author = "Franklin Webber"
|
12
13
|
g.email = "franklin.webber@gmail.com"
|
13
14
|
g.url = "http://github.com/burtlo/Cucumber-In-The-Yard"
|
14
15
|
g.description = %{
|
@@ -2,19 +2,19 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{cucumber-in-the-yard}
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["
|
9
|
-
s.date = %q{2010-10-
|
8
|
+
s.authors = ["Franklin Webber"]
|
9
|
+
s.date = %q{2010-10-17}
|
10
10
|
s.description = %q{
|
11
11
|
Cucumber-In-The-Yard is a YARD extension that processes Cucumber Features, Scenarios, Steps,
|
12
12
|
Step Definitions, Transforms, and Tags and provides a documentation interface that allows you
|
13
13
|
easily view and investigate the test suite. This tools hopes to bridge the gap of being able
|
14
14
|
to provide your feature descriptions to your Product Owners and Stakeholders. }
|
15
15
|
s.email = %q{franklin.webber@gmail.com}
|
16
|
-
s.extra_rdoc_files = ["README.md", "lib/city.rb", "lib/cucumber/city_builder.rb", "lib/
|
17
|
-
s.files = ["History.txt", "Manifest", "README.md", "Rakefile", "example/empty.feature", "example/example.feature", "example/example.
|
16
|
+
s.extra_rdoc_files = ["README.md", "lib/city.rb", "lib/cucumber/city_builder.rb", "lib/templates/default/feature/html/background.erb", "lib/templates/default/feature/html/feature.erb", "lib/templates/default/feature/html/no_steps_defined.erb", "lib/templates/default/feature/html/outline.erb", "lib/templates/default/feature/html/pystring.erb", "lib/templates/default/feature/html/scenario.erb", "lib/templates/default/feature/html/steps.erb", "lib/templates/default/feature/html/table.erb", "lib/templates/default/feature/setup.rb", "lib/templates/default/fulldoc/html/css/common.css", "lib/templates/default/fulldoc/html/full_list.erb", "lib/templates/default/fulldoc/html/full_list_features.erb", "lib/templates/default/fulldoc/html/full_list_requirements.erb", "lib/templates/default/fulldoc/html/full_list_scenarios.erb", "lib/templates/default/fulldoc/html/full_list_stepdefinitions.erb", "lib/templates/default/fulldoc/html/full_list_steps.erb", "lib/templates/default/fulldoc/html/full_list_tags.erb", "lib/templates/default/fulldoc/html/index.erb", "lib/templates/default/fulldoc/html/js/cucumber.js", "lib/templates/default/fulldoc/html/setup.rb", "lib/templates/default/layout/html/headers.erb", "lib/templates/default/layout/html/search.erb", "lib/templates/default/scenario/html/scenario.erb", "lib/templates/default/scenario/setup.rb", "lib/templates/default/steptransformers/html/stepdefinition.erb", "lib/templates/default/steptransformers/html/steptransformers.erb", "lib/templates/default/steptransformers/setup.rb", "lib/templates/default/tag/html/feature.erb", "lib/templates/default/tag/html/scenario.erb", "lib/templates/default/tag/html/tag.erb", "lib/templates/default/tag/setup.rb", "lib/yard/code_objects/cucumber/base.rb", "lib/yard/code_objects/cucumber/feature.rb", "lib/yard/code_objects/cucumber/namespace_object.rb", "lib/yard/code_objects/cucumber/scenario.rb", "lib/yard/code_objects/cucumber/step.rb", "lib/yard/code_objects/cucumber/tag.rb", "lib/yard/code_objects/namespace_object.rb", "lib/yard/code_objects/step_definition.rb", "lib/yard/code_objects/step_transform.rb", "lib/yard/handlers/cucumber/base.rb", "lib/yard/handlers/cucumber/feature_handler.rb", "lib/yard/handlers/step_definition_handler.rb", "lib/yard/handlers/step_transform_handler.rb", "lib/yard/parser/cucumber/feature.rb", "lib/yard/parser/source_parser.rb", "lib/yard/rake/city_task.rb", "lib/yard/templates/helpers/base_helper.rb"]
|
17
|
+
s.files = ["History.txt", "Manifest", "README.md", "Rakefile", "example/empty.feature", "example/example.feature", "example/example.third.feature", "example/second_example.feature", "example/step_definitions/example.step.rb", "example/step_definitions/support/env.rb", "example/step_definitions/support/env_support.rb", "example/step_definitions/support/support.rb", "features/definitions/city_step.rb", "features/definitions/test.setup.and.teardown.rb", "features/features.feature", "lib/city.rb", "lib/cucumber/city_builder.rb", "lib/templates/default/feature/html/background.erb", "lib/templates/default/feature/html/feature.erb", "lib/templates/default/feature/html/no_steps_defined.erb", "lib/templates/default/feature/html/outline.erb", "lib/templates/default/feature/html/pystring.erb", "lib/templates/default/feature/html/scenario.erb", "lib/templates/default/feature/html/steps.erb", "lib/templates/default/feature/html/table.erb", "lib/templates/default/feature/setup.rb", "lib/templates/default/fulldoc/html/css/common.css", "lib/templates/default/fulldoc/html/full_list.erb", "lib/templates/default/fulldoc/html/full_list_features.erb", "lib/templates/default/fulldoc/html/full_list_requirements.erb", "lib/templates/default/fulldoc/html/full_list_scenarios.erb", "lib/templates/default/fulldoc/html/full_list_stepdefinitions.erb", "lib/templates/default/fulldoc/html/full_list_steps.erb", "lib/templates/default/fulldoc/html/full_list_tags.erb", "lib/templates/default/fulldoc/html/index.erb", "lib/templates/default/fulldoc/html/js/cucumber.js", "lib/templates/default/fulldoc/html/setup.rb", "lib/templates/default/layout/html/headers.erb", "lib/templates/default/layout/html/search.erb", "lib/templates/default/scenario/html/scenario.erb", "lib/templates/default/scenario/setup.rb", "lib/templates/default/steptransformers/html/stepdefinition.erb", "lib/templates/default/steptransformers/html/steptransformers.erb", "lib/templates/default/steptransformers/setup.rb", "lib/templates/default/tag/html/feature.erb", "lib/templates/default/tag/html/scenario.erb", "lib/templates/default/tag/html/tag.erb", "lib/templates/default/tag/setup.rb", "lib/yard/code_objects/cucumber/base.rb", "lib/yard/code_objects/cucumber/feature.rb", "lib/yard/code_objects/cucumber/namespace_object.rb", "lib/yard/code_objects/cucumber/scenario.rb", "lib/yard/code_objects/cucumber/step.rb", "lib/yard/code_objects/cucumber/tag.rb", "lib/yard/code_objects/namespace_object.rb", "lib/yard/code_objects/step_definition.rb", "lib/yard/code_objects/step_transform.rb", "lib/yard/handlers/cucumber/base.rb", "lib/yard/handlers/cucumber/feature_handler.rb", "lib/yard/handlers/step_definition_handler.rb", "lib/yard/handlers/step_transform_handler.rb", "lib/yard/parser/cucumber/feature.rb", "lib/yard/parser/source_parser.rb", "lib/yard/rake/city_task.rb", "lib/yard/templates/helpers/base_helper.rb", "cucumber-in-the-yard.gemspec"]
|
18
18
|
s.homepage = %q{http://github.com/burtlo/Cucumber-In-The-Yard}
|
19
19
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Cucumber-in-the-yard", "--main", "README.md"]
|
20
20
|
s.require_paths = ["lib"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,89 @@
|
|
1
|
+
require 'rexml/document'
|
2
|
+
|
3
|
+
|
4
|
+
TARGET_MATCH = /the feature/
|
5
|
+
|
6
|
+
Transform /^the feature$/ do |feauture|
|
7
|
+
@cache[:feature]
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
Given /^the feature file, '([^']+)', is the (feature) for the scenario$/ do |name,type|
|
12
|
+
@cache[type.to_sym] = name
|
13
|
+
end
|
14
|
+
|
15
|
+
Then /^I expect (#{TARGET_MATCH}) file (\w+) to exist at '([^']+)'$/ do |target,file_type,path|
|
16
|
+
file = "#{$env[:documents]}/#{path}/#{target}.#{file_type}"
|
17
|
+
File.should exist(file)
|
18
|
+
file
|
19
|
+
end
|
20
|
+
|
21
|
+
Then /^I expect the feature title to be '([^']+)'$/ do |title|
|
22
|
+
xml = REXML::Document.new(File.open("doc/requirements/features/features.html"))
|
23
|
+
|
24
|
+
actual_title = xml.elements["//title"].text
|
25
|
+
actual_title.should == title
|
26
|
+
end
|
27
|
+
|
28
|
+
Then /^I expect the feature heading to be '([^']+)'$/ do |title|
|
29
|
+
xml = REXML::Document.new(File.open("doc/requirements/features/features.html"))
|
30
|
+
|
31
|
+
actual_title = "#{xml.elements["//*[@class='feature']/*[@class='title']/*[@class='pre']"].text} " +
|
32
|
+
"#{xml.elements["//*[@class='feature']/*[@class='title']/*[@class='name']"].text}"
|
33
|
+
|
34
|
+
actual_title.should == title
|
35
|
+
end
|
36
|
+
|
37
|
+
Then /^I expect the feature to have the (@\w+) tag$/ do |tag|
|
38
|
+
xml = REXML::Document.new(File.open("doc/requirements/features/features.html"))
|
39
|
+
|
40
|
+
found = false
|
41
|
+
|
42
|
+
xml.elements.each("//*[@class='feature']//*[@class='tags']/a") do |actual_tag|
|
43
|
+
found = true if actual_tag.text == tag
|
44
|
+
end
|
45
|
+
|
46
|
+
found.should be_true
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
Then /^I expect the feature description to be$/ do |description|
|
51
|
+
|
52
|
+
xml = REXML::Document.new(File.open("doc/requirements/features/features.html"))
|
53
|
+
xml.elements["//*[@class='feature']//*[@class='description']"].text.strip.should == description.strip
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
Then /^I expect the feature to have a background$/ do
|
58
|
+
|
59
|
+
xml = REXML::Document.new(File.open("doc/requirements/features/features.html"))
|
60
|
+
xml.elements["//*[@id='background']"].should_not be_nil
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
Then /^I expect the background to have steps?$/ do |string|
|
65
|
+
|
66
|
+
found = true
|
67
|
+
|
68
|
+
xml = REXML::Document.new(File.open("doc/requirements/features/features.html"))
|
69
|
+
xml.elements["//*[@id='backgroundSteps']"].elements.each do |step|
|
70
|
+
found = true if "#{step.elements["span[1]"].text}#{step.elements["span[2]"].text}" == string
|
71
|
+
end
|
72
|
+
|
73
|
+
found.should be_true
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
Then /^I expect the feature to have the scenarios:$/ do |string|
|
78
|
+
|
79
|
+
xml = REXML::Document.new(File.open("doc/requirements/features/features.html"))
|
80
|
+
string.split("\n").each do |expected_title|
|
81
|
+
found = nil
|
82
|
+
xml.elements.each("//*[@class='scenario']/*[@class='title']/*[@class='name']") do |scenario|
|
83
|
+
found = scenario if scenario.text == expected_title
|
84
|
+
end
|
85
|
+
found.should_not be_nil
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#
|
2
|
+
# Before all of the scenarios....
|
3
|
+
#
|
4
|
+
Before do
|
5
|
+
$env = {}
|
6
|
+
$env[:documents] = 'doc'
|
7
|
+
@cache = {}
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
#
|
12
|
+
# Before each scenario ...
|
13
|
+
#
|
14
|
+
Before do |scenario|
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
#
|
19
|
+
# After each scenario...
|
20
|
+
#
|
21
|
+
After do |scenario|
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
at_exit do
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
@feature
|
2
|
+
Feature: Features Page
|
3
|
+
As a Cucumber-In-The-YARD user I rely on the ability to view the details of each feature.
|
4
|
+
|
5
|
+
Background:
|
6
|
+
Given the feature file, 'features', is the feature for the scenario
|
7
|
+
|
8
|
+
|
9
|
+
Scenario: Location
|
10
|
+
Then I expect the feature file html to exist at 'requirements/features'
|
11
|
+
|
12
|
+
Scenario: Identification
|
13
|
+
Then I expect the feature title to be 'Feature: Features Page'
|
14
|
+
And I expect the feature heading to be 'Feature: Features Page'
|
15
|
+
|
16
|
+
Scenario: Tags
|
17
|
+
Then I expect the feature to have the @feature tag
|
18
|
+
|
19
|
+
Scenario: Description
|
20
|
+
Then I expect the feature description to be
|
21
|
+
"""
|
22
|
+
As a Cucumber-In-The-YARD user I rely on the ability to view the details of each feature.
|
23
|
+
"""
|
24
|
+
|
25
|
+
Scenario: Background
|
26
|
+
Then I expect the feature to have a background
|
27
|
+
And I expect the background to have steps
|
28
|
+
"""
|
29
|
+
Given the feature, 'features.feature', is the feature for the scenario
|
30
|
+
"""
|
31
|
+
|
32
|
+
Scenario: Scenarios
|
33
|
+
Then I expect the feature to have the scenarios:
|
34
|
+
"""
|
35
|
+
Location
|
36
|
+
Identification
|
37
|
+
Tags
|
38
|
+
Description
|
39
|
+
Background
|
40
|
+
Scenarios
|
41
|
+
"""
|
42
|
+
|
43
|
+
|
44
|
+
|
data/lib/city.rb
CHANGED
@@ -3,21 +3,30 @@ require 'cucumber/parser/gherkin_builder'
|
|
3
3
|
require 'gherkin/parser/parser'
|
4
4
|
require 'gherkin/formatter/tag_count_formatter'
|
5
5
|
|
6
|
+
require 'yard'
|
7
|
+
|
8
|
+
require File.dirname(__FILE__) + "/yard/code_objects/cucumber/base.rb"
|
9
|
+
require File.dirname(__FILE__) + "/yard/code_objects/cucumber/namespace_object.rb"
|
10
|
+
require File.dirname(__FILE__) + "/yard/code_objects/cucumber/feature.rb"
|
11
|
+
require File.dirname(__FILE__) + "/yard/code_objects/cucumber/scenario.rb"
|
12
|
+
require File.dirname(__FILE__) + "/yard/code_objects/cucumber/step.rb"
|
13
|
+
require File.dirname(__FILE__) + "/yard/code_objects/cucumber/tag.rb"
|
14
|
+
|
6
15
|
require File.dirname(__FILE__) + "/cucumber/city_builder.rb"
|
7
16
|
|
8
|
-
require
|
17
|
+
require File.dirname(__FILE__) + "/yard/code_objects/step_definition.rb"
|
18
|
+
require File.dirname(__FILE__) + "/yard/code_objects/step_transform.rb"
|
19
|
+
require File.dirname(__FILE__) + "/yard/code_objects/namespace_object.rb"
|
20
|
+
|
21
|
+
require File.dirname(__FILE__) + "/yard/parser/cucumber/feature.rb"
|
9
22
|
|
10
|
-
require File.dirname(__FILE__) + "/yard/
|
11
|
-
require File.dirname(__FILE__) + "/yard/
|
12
|
-
require File.dirname(__FILE__) + "/yard/code_objects/scenario.rb"
|
13
|
-
require File.dirname(__FILE__) + "/yard/code_objects/step.rb"
|
14
|
-
require File.dirname(__FILE__) + "/yard/code_objects/tags.rb"
|
23
|
+
require File.dirname(__FILE__) + "/yard/handlers/cucumber/base.rb"
|
24
|
+
require File.dirname(__FILE__) + "/yard/handlers/cucumber/feature_handler.rb"
|
15
25
|
|
16
|
-
require File.dirname(__FILE__) + "/yard/
|
17
|
-
require File.dirname(__FILE__) + "/yard/
|
18
|
-
require File.dirname(__FILE__) + "/yard/parser/feature.rb"
|
19
|
-
require File.dirname(__FILE__) + "/yard/handlers/base.rb"
|
20
|
-
require File.dirname(__FILE__) + "/yard/handlers/feature_handler.rb"
|
26
|
+
require File.dirname(__FILE__) + "/yard/handlers/step_definition_handler.rb"
|
27
|
+
require File.dirname(__FILE__) + "/yard/handlers/step_transform_handler.rb"
|
21
28
|
|
29
|
+
require File.dirname(__FILE__) + "/yard/parser/source_parser.rb"
|
30
|
+
require File.dirname(__FILE__) + "/yard/templates/helpers/base_helper.rb"
|
22
31
|
require File.dirname(__FILE__) + "/yard/rake/city_task.rb"
|
23
32
|
|