cucumber-in-the-yard 1.6.1 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +13 -0
- data/README.md +27 -50
- data/example/child_feature/grandchild_feature/scenario.feature +52 -0
- data/example/child_feature/scenario.feature +52 -0
- data/example/scenario.feature +51 -0
- data/example/scenario_outline.feature +60 -0
- data/example/step_definitions/example.step.rb +7 -2
- data/example/step_definitions/first.step.rb +15 -0
- data/example/step_definitions/support/support.rb +6 -0
- data/example/transform.feature +13 -0
- data/lib/city.rb +2 -1
- data/lib/cucumber/city_builder.rb +10 -0
- data/lib/templates/default/feature/html/no_steps_defined.erb +1 -1
- data/lib/templates/default/feature/html/outline.erb +36 -29
- data/lib/templates/default/feature/html/scenario.erb +1 -1
- data/lib/templates/default/feature/html/steps.erb +20 -8
- data/lib/templates/default/feature/html/table.erb +16 -16
- data/lib/templates/default/feature/setup.rb +1 -1
- data/lib/templates/default/{tags → featuretags}/html/namespace.erb +0 -0
- data/lib/templates/default/{tags → featuretags}/html/setup.rb +0 -0
- data/lib/templates/default/fulldoc/html/css/common.css +25 -5
- data/lib/templates/default/requirements/html/namespace.erb +47 -34
- data/lib/templates/default/requirements/html/setup.rb +16 -5
- data/lib/templates/default/steptransformers/html/transformers.erb +5 -0
- data/lib/templates/default/steptransformers/html/undefined_steps.erb +30 -0
- data/lib/templates/default/steptransformers/setup.rb +17 -7
- data/lib/yard/code_objects/cucumber/namespace_object.rb +2 -2
- data/lib/yard/code_objects/step_definition.rb +2 -35
- data/lib/yard/code_objects/step_transform.rb +1 -34
- data/lib/yard/code_objects/step_transformer.rb +50 -0
- data/lib/yard/handlers/cucumber/feature_handler.rb +1 -1
- data/lib/yard/handlers/step_definition_handler.rb +0 -36
- data/lib/yard/handlers/step_transform_handler.rb +1 -33
- metadata +27 -22
- data/.autotest +0 -15
- data/autotest/discover.rb +0 -3
- data/example/example.third.feature +0 -33
- data/example/first_example.feature +0 -19
- data/example/second_example.feature +0 -51
- data/example/sub_features/second_example.feature +0 -51
- 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
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: 9
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 6
|
8
|
-
-
|
9
|
-
version: 1.6.
|
9
|
+
- 3
|
10
|
+
version: 1.6.3
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Franklin Webber
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-08 00:00:00 -08:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: gherkin
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 21
|
27
30
|
segments:
|
28
31
|
- 2
|
29
32
|
- 2
|
@@ -35,9 +38,11 @@ dependencies:
|
|
35
38
|
name: cucumber
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 9
|
41
46
|
segments:
|
42
47
|
- 0
|
43
48
|
- 7
|
@@ -49,9 +54,11 @@ dependencies:
|
|
49
54
|
name: yard
|
50
55
|
prerelease: false
|
51
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
52
58
|
requirements:
|
53
59
|
- - ">="
|
54
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 5
|
55
62
|
segments:
|
56
63
|
- 0
|
57
64
|
- 6
|
@@ -69,22 +76,22 @@ extra_rdoc_files:
|
|
69
76
|
- README.md
|
70
77
|
- History.txt
|
71
78
|
files:
|
72
|
-
- .autotest
|
73
79
|
- .rspec
|
74
80
|
- History.txt
|
75
81
|
- README.md
|
76
82
|
- Rakefile
|
77
|
-
- autotest/discover.rb
|
78
83
|
- city.gemspec
|
84
|
+
- example/child_feature/grandchild_feature/scenario.feature
|
85
|
+
- example/child_feature/scenario.feature
|
79
86
|
- example/empty.feature
|
80
|
-
- example/
|
81
|
-
- example/
|
82
|
-
- example/second_example.feature
|
87
|
+
- example/scenario.feature
|
88
|
+
- example/scenario_outline.feature
|
83
89
|
- example/step_definitions/example.step.rb
|
90
|
+
- example/step_definitions/first.step.rb
|
84
91
|
- example/step_definitions/support/env.rb
|
85
92
|
- example/step_definitions/support/env_support.rb
|
86
93
|
- example/step_definitions/support/support.rb
|
87
|
-
- example/
|
94
|
+
- example/transform.feature
|
88
95
|
- lib/city.rb
|
89
96
|
- lib/cucumber/city_builder.rb
|
90
97
|
- lib/templates/default/feature/html/background.erb
|
@@ -98,6 +105,8 @@ files:
|
|
98
105
|
- lib/templates/default/feature/setup.rb
|
99
106
|
- lib/templates/default/featuredirectory/html/directory.erb
|
100
107
|
- lib/templates/default/featuredirectory/html/setup.rb
|
108
|
+
- lib/templates/default/featuretags/html/namespace.erb
|
109
|
+
- lib/templates/default/featuretags/html/setup.rb
|
101
110
|
- lib/templates/default/fulldoc/html/css/common.css
|
102
111
|
- lib/templates/default/fulldoc/html/full_list.erb
|
103
112
|
- lib/templates/default/fulldoc/html/full_list_features.erb
|
@@ -115,13 +124,12 @@ files:
|
|
115
124
|
- lib/templates/default/scenario/setup.rb
|
116
125
|
- lib/templates/default/steptransformers/html/steptransformers.erb
|
117
126
|
- lib/templates/default/steptransformers/html/transformers.erb
|
127
|
+
- lib/templates/default/steptransformers/html/undefined_steps.erb
|
118
128
|
- lib/templates/default/steptransformers/setup.rb
|
119
129
|
- lib/templates/default/tag/html/feature.erb
|
120
130
|
- lib/templates/default/tag/html/scenario.erb
|
121
131
|
- lib/templates/default/tag/html/tag.erb
|
122
132
|
- lib/templates/default/tag/setup.rb
|
123
|
-
- lib/templates/default/tags/html/namespace.erb
|
124
|
-
- lib/templates/default/tags/html/setup.rb
|
125
133
|
- lib/yard/code_objects/cucumber/base.rb
|
126
134
|
- lib/yard/code_objects/cucumber/feature.rb
|
127
135
|
- lib/yard/code_objects/cucumber/namespace_object.rb
|
@@ -132,6 +140,7 @@ files:
|
|
132
140
|
- lib/yard/code_objects/namespace_object.rb
|
133
141
|
- lib/yard/code_objects/step_definition.rb
|
134
142
|
- lib/yard/code_objects/step_transform.rb
|
143
|
+
- lib/yard/code_objects/step_transformer.rb
|
135
144
|
- lib/yard/handlers/cucumber/base.rb
|
136
145
|
- lib/yard/handlers/cucumber/feature_handler.rb
|
137
146
|
- lib/yard/handlers/step_definition_handler.rb
|
@@ -140,14 +149,6 @@ files:
|
|
140
149
|
- lib/yard/parser/source_parser.rb
|
141
150
|
- lib/yard/rake/city_task.rb
|
142
151
|
- lib/yard/templates/helpers/base_helper.rb
|
143
|
-
- spec/city/feature_parser_spec_examples.rb
|
144
|
-
- spec/city/gherkin_loader_spec.rb
|
145
|
-
- spec/city/test.feature
|
146
|
-
- spec/city/yard_handlers_cucumber_spec.rb
|
147
|
-
- spec/city/yard_namespace_object_spec.rb
|
148
|
-
- spec/city/yard_parser_cucumber_spec.rb
|
149
|
-
- spec/city/yard_rb_extensions_spec.rb
|
150
|
-
- spec/spec_helper.rb
|
151
152
|
has_rdoc: true
|
152
153
|
homepage: http://github.com/burtlo/Cucumber-In-The-Yard
|
153
154
|
licenses: []
|
@@ -156,11 +157,11 @@ post_install_message: |+
|
|
156
157
|
|
157
158
|
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
|
158
159
|
|
159
|
-
Thank you for installing Cucumber-In-The-YARD 1.6.
|
160
|
+
Thank you for installing Cucumber-In-The-YARD 1.6.3 / 2010-11-08.
|
160
161
|
|
161
162
|
Changes:
|
162
163
|
|
163
|
-
* FIX
|
164
|
+
* FIX Step Definitions and Step Transforms incorrectly cached the YARD Constants
|
164
165
|
|
165
166
|
|
166
167
|
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
|
@@ -170,23 +171,27 @@ rdoc_options:
|
|
170
171
|
require_paths:
|
171
172
|
- lib
|
172
173
|
required_ruby_version: !ruby/object:Gem::Requirement
|
174
|
+
none: false
|
173
175
|
requirements:
|
174
176
|
- - ">="
|
175
177
|
- !ruby/object:Gem::Version
|
178
|
+
hash: 3
|
176
179
|
segments:
|
177
180
|
- 0
|
178
181
|
version: "0"
|
179
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
+
none: false
|
180
184
|
requirements:
|
181
185
|
- - ">="
|
182
186
|
- !ruby/object:Gem::Version
|
187
|
+
hash: 3
|
183
188
|
segments:
|
184
189
|
- 0
|
185
190
|
version: "0"
|
186
191
|
requirements: []
|
187
192
|
|
188
193
|
rubyforge_project:
|
189
|
-
rubygems_version: 1.3.
|
194
|
+
rubygems_version: 1.3.7
|
190
195
|
signing_key:
|
191
196
|
specification_version: 3
|
192
197
|
summary: Cucumber Features in YARD
|
data/.autotest
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'autotest/growl'
|
2
|
-
|
3
|
-
Autotest.add_hook :initialize do |at|
|
4
|
-
#%w{ features definitions common browser jmx }.each {|exception| at.add_exception(exception)}
|
5
|
-
end
|
6
|
-
|
7
|
-
# Overrides to include the required folders to make this project autotestable
|
8
|
-
# This is because requires cannot exist within the options file
|
9
|
-
class Autotest::Rspec < Autotest
|
10
|
-
def make_test_cmd(files_to_test)
|
11
|
-
files_to_test.empty? ? '' :
|
12
|
-
"#{ruby} #{SPEC_PROGRAM} -r lib/city.rb --color --autospec #{normalize(files_to_test).keys.flatten.join(' ')} #{add_options_if_present}"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
data/autotest/discover.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
@customer
|
2
|
-
Feature: Customer Account
|
3
|
-
As a customer of the product I am able to configure settings for my account
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given this third defined step definition
|
7
|
-
And the customer has the following details:
|
8
|
-
| Name | Email | Age |
|
9
|
-
| Roger | r@email.com | 22 |
|
10
|
-
|
11
|
-
@bvt
|
12
|
-
Scenario: Customer is able to change their password
|
13
|
-
Given that a customer that is logged in to the system
|
14
|
-
When the customer changes their password to 'lions_tigers_and_bears'
|
15
|
-
Then I expect when they login again that it will use this new password
|
16
|
-
|
17
|
-
@wip
|
18
|
-
Scenario: Customer cannot change settings if they are not logged in
|
19
|
-
Given that a customer is a valid customer
|
20
|
-
When the customer visits the account settings page
|
21
|
-
Then I expect the customer to be presented with the login page
|
22
|
-
|
23
|
-
@wip
|
24
|
-
Scenario: Customer cannot change settings if they are not logged in
|
25
|
-
Given that a customer that is logged in to the system
|
26
|
-
When the customer visits the account settings page
|
27
|
-
And edits their the biography to state:
|
28
|
-
"""
|
29
|
-
I am an avid golfer, spelunker, and designer of clothing for stuffed
|
30
|
-
animals.
|
31
|
-
"""
|
32
|
-
Then I expect the customer to be presented with the login page
|
33
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
@feature @bvt
|
2
|
-
Feature: Feature File
|
3
|
-
As a product owner it is important for me to be able to view a feature file through
|
4
|
-
an interface which is easily accessible. A feature's description appears along side
|
5
|
-
the comments for the feature.
|
6
|
-
|
7
|
-
Background:
|
8
|
-
Given this first background step
|
9
|
-
|
10
|
-
@bvt
|
11
|
-
Scenario: First Scenario
|
12
|
-
Given this first scenario step
|
13
|
-
When this is parsed with Cucumber-In-The-YARD
|
14
|
-
Then I expect that each step is highlighted and matched to a step definition
|
15
|
-
|
16
|
-
Scenario: Second Scenario
|
17
|
-
Given this first scenario step
|
18
|
-
When this is parsed with Cucumber-In-The-YARD
|
19
|
-
Then I expect that this scenario is present
|
@@ -1,51 +0,0 @@
|
|
1
|
-
@customer
|
2
|
-
Feature: Customer Logout Feature
|
3
|
-
As a customer of the product I am able to logout
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given this undefined step definition
|
7
|
-
|
8
|
-
@bvt @param2 @param3
|
9
|
-
Scenario: Customer that is logged in is able to log out
|
10
|
-
Given that a customer is a valid customer
|
11
|
-
And a customer logs in as username 'frank' with password 'default'
|
12
|
-
And I expect them to have logged in successfully
|
13
|
-
When the customer logs out
|
14
|
-
Then I expect the customer to be shown the logout page
|
15
|
-
|
16
|
-
Scenario: Customers with a complete profile are allowed to post
|
17
|
-
Given that a customer is a valid customer
|
18
|
-
And the customer has the following details:
|
19
|
-
| Name | Email | Age |
|
20
|
-
| Roger | r@email.com | 22 |
|
21
|
-
And the customer has the following details:
|
22
|
-
| Name | Email | Age |
|
23
|
-
| Roger | r@email.com | 22 |
|
24
|
-
When a customer logs in as username 'frank' with password 'default'
|
25
|
-
And visits the customer update page
|
26
|
-
Then I expect the customer is able able to post to their profile
|
27
|
-
|
28
|
-
@optional_parameters
|
29
|
-
Scenario: Optional Parameter Step Definition
|
30
|
-
# This step definition has some optional parameters
|
31
|
-
Given a project
|
32
|
-
And an inactive project
|
33
|
-
And a project with the name 'optional', start date 10/26/2010, nicknamed 'norman'
|
34
|
-
|
35
|
-
@highlighting
|
36
|
-
Scenario: Highlighting
|
37
|
-
Given a duck that has a bill
|
38
|
-
Then I expect the duck to quack
|
39
|
-
|
40
|
-
@product
|
41
|
-
Scenario Outline: Customers that bought a product are included in their product groups
|
42
|
-
Given that <Customer> is a valid customer
|
43
|
-
And that the product, named '<Product>', is a valid product
|
44
|
-
When the customer has purchased the product
|
45
|
-
Then I expect the customer to be a member of the '<Product>' group
|
46
|
-
|
47
|
-
Examples:
|
48
|
-
| Customer | Product |
|
49
|
-
| Customer A | Product A |
|
50
|
-
| Customer A | Product B |
|
51
|
-
| Customer A | Product C |
|
@@ -1,51 +0,0 @@
|
|
1
|
-
@customer
|
2
|
-
Feature: Customer Logout Feature
|
3
|
-
As a customer of the product I am able to logout
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given this undefined step definition
|
7
|
-
|
8
|
-
@bvt @param2 @param3
|
9
|
-
Scenario: Customer that is logged in is able to log out
|
10
|
-
Given that a customer is a valid customer
|
11
|
-
And a customer logs in as username 'frank' with password 'default'
|
12
|
-
And I expect them to have logged in successfully
|
13
|
-
When the customer logs out
|
14
|
-
Then I expect the customer to be shown the logout page
|
15
|
-
|
16
|
-
Scenario: Customers with a complete profile are allowed to post
|
17
|
-
Given that a customer is a valid customer
|
18
|
-
And the customer has the following details:
|
19
|
-
| Name | Email | Age |
|
20
|
-
| Roger | r@email.com | 22 |
|
21
|
-
And the customer has the following details:
|
22
|
-
| Name | Email | Age |
|
23
|
-
| Roger | r@email.com | 22 |
|
24
|
-
When a customer logs in as username 'frank' with password 'default'
|
25
|
-
And visits the customer update page
|
26
|
-
Then I expect the customer is able able to post to their profile
|
27
|
-
|
28
|
-
@optional_parameters
|
29
|
-
Scenario: Optional Parameter Step Definition
|
30
|
-
# This step definition has some optional parameters
|
31
|
-
Given a project
|
32
|
-
And an inactive project
|
33
|
-
And a project with the name 'optional', start date 10/26/2010, nicknamed 'norman'
|
34
|
-
|
35
|
-
@highlighting
|
36
|
-
Scenario: Highlighting
|
37
|
-
Given a duck that has a bill
|
38
|
-
Then I expect the duck to quack
|
39
|
-
|
40
|
-
@product
|
41
|
-
Scenario Outline: Customers that bought a product are included in their product groups
|
42
|
-
Given that <Customer> is a valid customer
|
43
|
-
And that the product, named '<Product>', is a valid product
|
44
|
-
When the customer has purchased the product
|
45
|
-
Then I expect the customer to be a member of the '<Product>' group
|
46
|
-
|
47
|
-
Examples:
|
48
|
-
| Customer | Product |
|
49
|
-
| Customer A | Product A |
|
50
|
-
| Customer A | Product B |
|
51
|
-
| Customer A | Product C |
|
@@ -1,153 +0,0 @@
|
|
1
|
-
|
2
|
-
shared_examples_for "a feature file" do
|
3
|
-
it "should have a defined feature" do
|
4
|
-
@parser.features.first.should_not be_nil
|
5
|
-
end
|
6
|
-
|
7
|
-
it "the feature should have a unique name" do
|
8
|
-
@parser.features.first.name.should == @feature[:file].gsub('.','_').to_sym
|
9
|
-
end
|
10
|
-
|
11
|
-
it "the feature should have the specified title" do
|
12
|
-
@parser.features.first.value.should == @feature[:name]
|
13
|
-
end
|
14
|
-
|
15
|
-
it "the feature should have all specified tags" do
|
16
|
-
@feature[:tags].find do |expected_tag|
|
17
|
-
@parser.features.first.tags.find{|tag| tag.value == expected_tag }
|
18
|
-
end.should_not be_nil
|
19
|
-
end
|
20
|
-
|
21
|
-
it "the feature should have the correct number of tags" do
|
22
|
-
@feature[:tags].each do |expected_tag|
|
23
|
-
@parser.features.first.tags.find_all {|tag| tag.value == expected_tag }.count.should == 1
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
it "the feature's tags should have a file" do
|
28
|
-
@parser.features.first.tags.each do |tag|
|
29
|
-
tag.files.should_not be_nil
|
30
|
-
tag.files.should_not be_empty
|
31
|
-
tag.files.first.first.should == @feature[:file]
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
it "the feature should have a description" do
|
36
|
-
@parser.features.first.description.join("\n") == @feature[:description].join("\n")
|
37
|
-
end
|
38
|
-
|
39
|
-
it "the feature should have a file" do
|
40
|
-
@parser.features.first.files.first[0].should == @feature[:file]
|
41
|
-
end
|
42
|
-
|
43
|
-
it "the feature should have a line number" do
|
44
|
-
@parser.features.first.files.first[1].should_not be_nil
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
shared_examples_for "a feature file with a background" do
|
50
|
-
|
51
|
-
it "the feature should have a background" do
|
52
|
-
@parser.features.first.background.should_not be_nil
|
53
|
-
end
|
54
|
-
|
55
|
-
it "the background should have a unique scenario name" do
|
56
|
-
@parser.features.first.background.name.should == "#{@feature[:file]}.background".gsub('.','_').to_sym
|
57
|
-
end
|
58
|
-
|
59
|
-
it "the background should have the correct title" do
|
60
|
-
@parser.features.first.background.value.should == "Background"
|
61
|
-
end
|
62
|
-
|
63
|
-
it "the background should have a file" do
|
64
|
-
@parser.features.first.background.files.first[0].should == @feature[:file]
|
65
|
-
end
|
66
|
-
|
67
|
-
it "the background should have a line number" do
|
68
|
-
@parser.features.first.background.files.first[1].should_not be_nil
|
69
|
-
end
|
70
|
-
|
71
|
-
it "the background should have all their defined steps" do
|
72
|
-
@parser.features.first.scenarios.first.steps.should_not be_nil
|
73
|
-
if @background
|
74
|
-
@background.each_with_index do |step,index|
|
75
|
-
@parser.features.first.background.steps[index].value.should == step
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
it "the background steps should have files and line numbers" do
|
81
|
-
if @background
|
82
|
-
@background.each_with_index do |step,index|
|
83
|
-
@parser.features.first.background.steps[index].files.first[0].should == @feature[:file]
|
84
|
-
@parser.features.first.background.steps[index].files.first[1].should_not be_nil
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
shared_examples_for "a feature file with scenarios" do
|
92
|
-
it "should have all scenarios" do
|
93
|
-
@scenarios.each_with_index do |scenario,index|
|
94
|
-
@parser.features.first.scenarios[index].should_not be_nil
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
it "each scenario should have a unique scenario name" do
|
99
|
-
@parser.features.first.scenarios.first.name.should == "#{@feature[:file]}_scenario_0".gsub('.','_').to_sym
|
100
|
-
end
|
101
|
-
|
102
|
-
it "each scenario should have the correct title" do
|
103
|
-
@parser.features.first.scenarios.each_with_index do |scenario,index|
|
104
|
-
scenario.value.should == @scenarios[index][:title].join("\n")
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
it "each scenario should have the correct tags" do
|
109
|
-
@scenarios.each_with_index do |scenario,index|
|
110
|
-
scenario[:tags].each do |expeced_tag|
|
111
|
-
@parser.features.first.scenarios[index].tags.find {|tag| tag.value == expeced_tag}.should_not be_nil
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
it "each scenario should have the correct number of tags" do
|
117
|
-
@parser.features.first.scenarios.first.tags.find_all {|tag| tag.value == "@ninja" }.count.should == 1
|
118
|
-
end
|
119
|
-
|
120
|
-
it "each scenario should have a file" do
|
121
|
-
@parser.features.first.scenarios.first.files.first[0].should == @feature[:file]
|
122
|
-
end
|
123
|
-
|
124
|
-
it "each scenario should have a line number" do
|
125
|
-
@parser.features.first.scenarios.first.files.first[1].should_not be_nil
|
126
|
-
end
|
127
|
-
|
128
|
-
it "each scenario should have all their defined steps" do
|
129
|
-
@parser.features.first.scenarios.first.steps.should_not be_nil
|
130
|
-
if @scenarios
|
131
|
-
@scenarios.each_with_index do |scenario,scenario_index|
|
132
|
-
@parser.features.first.scenarios[scenario_index].should_not be_nil
|
133
|
-
|
134
|
-
scenario[:steps].each_with_index do |step,step_index|
|
135
|
-
@parser.features.first.scenarios[scenario_index].steps[step_index].name.should == "#{@feature[:file].gsub('.','_')}_scenario_#{scenario_index}_step_#{step_index}".to_sym
|
136
|
-
@parser.features.first.scenarios[scenario_index].steps[step_index].value.should == step
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
it "each scenario's steps should have files and line numbers" do
|
143
|
-
if @scenarios
|
144
|
-
@scenarios.each_with_index do |scenario,scenario_index|
|
145
|
-
scenario[:steps].each_with_index do |step,step_index|
|
146
|
-
@parser.features.first.scenarios[scenario_index].steps[step_index].files.first[0].should == @feature[:file]
|
147
|
-
@parser.features.first.scenarios[scenario_index].steps[step_index].files.first[1].should_not be_nil
|
148
|
-
end
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe "Gherkin" do
|
4
|
-
|
5
|
-
|
6
|
-
before(:all) do
|
7
|
-
|
8
|
-
@source = File.dirname(__FILE__) + '/test.feature'
|
9
|
-
File.should exist(@source)
|
10
|
-
@data = File.open(@source, 'r').read
|
11
|
-
|
12
|
-
@parser = YARD::Parser::Cucumber::FeatureParser.new(@data,@source)
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
it "should not be nil" do
|
18
|
-
@parser.should_not be_nil
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should parse" do
|
22
|
-
@parser.parse
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should tokenize" do
|
26
|
-
@parser.tokenize
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should enumerator" do
|
30
|
-
@parser.enumerator
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
end
|
data/spec/city/test.feature
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
@customer
|
2
|
-
Feature: Customer Logout Feature
|
3
|
-
As a customer of the product I am able to logout
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given this undefined step definition
|
7
|
-
|
8
|
-
@bvt
|
9
|
-
Scenario: Customer that is logged in is able to log out
|
10
|
-
Given that a customer is a valid customer
|
11
|
-
And a customer logs in as username 'frank' with password 'default'
|
12
|
-
And I expect them to have logged in successfully
|
13
|
-
When the customer logs out
|
14
|
-
Then I expect the customer to be shown the logout page
|
15
|
-
|
16
|
-
Scenario: Customers with a complete profile are allowed to post
|
17
|
-
Given that a customer is a valid customer
|
18
|
-
And the customer has the following details:
|
19
|
-
| Name | Email | Age |
|
20
|
-
| Frank | f@email.com | 22 |
|
21
|
-
When a customer logs in as username 'frank' with password 'default'
|
22
|
-
And visits the customer update page
|
23
|
-
Then I expect the customer is able able to post to their profile
|
24
|
-
|
25
|
-
@product
|
26
|
-
Scenario Outline: Customers that bought a product are included in their product groups
|
27
|
-
Given that <Customer> is a valid customer
|
28
|
-
And that the product, named '<Product>', is a valid product
|
29
|
-
When the customer has purchased the product
|
30
|
-
Then I expect the customer to be a member of the '<Product>' group
|
31
|
-
|
32
|
-
Examples:
|
33
|
-
| Customer | Product |
|
34
|
-
| Customer A | Product A |
|
35
|
-
| Customer A | Product B |
|
36
|
-
| Customer A | Product C |
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
module YARD::Handlers::Cucumber
|
4
|
-
|
5
|
-
describe Base do
|
6
|
-
|
7
|
-
it "should respond to method handles?" do
|
8
|
-
Base.should respond_to(:handles?)
|
9
|
-
end
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
describe FeatureHandler do
|
14
|
-
|
15
|
-
it "should respond to method process" do
|
16
|
-
FeatureHandler.should respond_to(:process)
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|