cucumber_analytics 0.0.9 → 1.0.0
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 +15 -0
- data/History.rdoc +16 -0
- data/README.rdoc +5 -3
- data/Rakefile +7 -2
- data/cucumber_analytics.gemspec +7 -5
- data/features/analysis/step_collection.feature +44 -45
- data/features/modeling/background_modeling.feature +14 -144
- data/features/modeling/directory_modeling.feature +3 -2
- data/features/modeling/doc_string_modeling.feature +46 -0
- data/features/modeling/example_modeling.feature +13 -34
- data/features/modeling/feature_file_modeling.feature +3 -2
- data/features/modeling/feature_modeling.feature +18 -80
- data/features/modeling/outline_modeling.feature +25 -164
- data/features/modeling/scenario_modeling.feature +17 -144
- data/features/modeling/step_modeling.feature +68 -0
- data/features/modeling/table_modeling.feature +41 -0
- data/features/step_definitions/background_steps.rb +12 -11
- data/features/step_definitions/directory_steps.rb +6 -3
- data/features/step_definitions/doc_string_steps.rb +50 -0
- data/features/step_definitions/{file_steps.rb → feature_file_steps.rb} +8 -2
- data/features/step_definitions/feature_steps.rb +8 -4
- data/features/step_definitions/outline_steps.rb +12 -6
- data/features/step_definitions/setup_steps.rb +2 -2
- data/features/step_definitions/spec_steps.rb +6 -3
- data/features/step_definitions/step_steps.rb +91 -0
- data/features/step_definitions/table_steps.rb +10 -0
- data/features/step_definitions/test_steps.rb +6 -10
- data/features/step_definitions/world_steps.rb +28 -19
- data/features/support/env.rb +0 -2
- data/lib/cucumber_analytics/background.rb +16 -0
- data/lib/cucumber_analytics/containing.rb +18 -0
- data/lib/cucumber_analytics/directory.rb +83 -0
- data/lib/cucumber_analytics/doc_string.rb +55 -0
- data/lib/cucumber_analytics/example.rb +100 -0
- data/lib/cucumber_analytics/feature.rb +120 -0
- data/lib/cucumber_analytics/feature_element.rb +22 -40
- data/lib/cucumber_analytics/feature_file.rb +74 -0
- data/lib/cucumber_analytics/outline.rb +49 -0
- data/lib/cucumber_analytics/parsing.rb +30 -0
- data/lib/cucumber_analytics/scenario.rb +31 -0
- data/lib/cucumber_analytics/step.rb +142 -32
- data/lib/cucumber_analytics/table.rb +51 -0
- data/lib/cucumber_analytics/taggable.rb +35 -0
- data/lib/cucumber_analytics/test_element.rb +36 -91
- data/lib/cucumber_analytics/version.rb +1 -1
- data/lib/cucumber_analytics/world.rb +109 -153
- data/lib/cucumber_analytics.rb +12 -8
- data/spec/integration/background_integration_spec.rb +18 -0
- data/spec/integration/directory_integration_spec.rb +24 -0
- data/spec/{feature_spec.rb → integration/feature_file_integration_spec.rb} +5 -5
- data/spec/integration/feature_integration_spec.rb +86 -0
- data/spec/integration/outline_integration_spec.rb +22 -0
- data/spec/integration/scenario_integration_spec.rb +18 -0
- data/spec/integration/step_integration_spec.rb +116 -0
- data/spec/integration/world_integration_spec.rb +40 -0
- data/spec/spec_helper.rb +7 -3
- data/spec/unit/background_unit_spec.rb +22 -0
- data/spec/unit/bare_bones_unit_specs.rb +13 -0
- data/spec/unit/containing_element_unit_specs.rb +17 -0
- data/spec/unit/directory_unit_spec.rb +91 -0
- data/spec/unit/doc_string_unit_spec.rb +65 -0
- data/spec/unit/example_unit_spec.rb +171 -0
- data/spec/unit/feature_element_unit_spec.rb +19 -0
- data/spec/unit/feature_element_unit_specs.rb +39 -0
- data/spec/unit/feature_file_unit_spec.rb +82 -0
- data/spec/unit/feature_unit_spec.rb +81 -0
- data/spec/unit/nested_element_unit_specs.rb +24 -0
- data/spec/unit/outline_unit_spec.rb +56 -0
- data/spec/unit/parsing_unit_spec.rb +21 -0
- data/spec/unit/prepopulated_unit_specs.rb +13 -0
- data/spec/unit/scenario_unit_spec.rb +36 -0
- data/spec/unit/step_unit_spec.rb +231 -0
- data/spec/unit/table_unit_spec.rb +52 -0
- data/spec/unit/taggable_unit_spec.rb +63 -0
- data/spec/unit/tagged_element_unit_specs.rb +48 -0
- data/spec/unit/test_element_unit_spec.rb +40 -0
- data/spec/unit/test_element_unit_specs.rb +31 -0
- data/spec/unit/world_unit_spec.rb +167 -0
- metadata +106 -41
- data/lib/cucumber_analytics/logging.rb +0 -28
- data/lib/cucumber_analytics/outline_example.rb +0 -110
- data/lib/cucumber_analytics/parsed_background.rb +0 -45
- data/lib/cucumber_analytics/parsed_directory.rb +0 -78
- data/lib/cucumber_analytics/parsed_feature.rb +0 -97
- data/lib/cucumber_analytics/parsed_file.rb +0 -199
- data/lib/cucumber_analytics/parsed_scenario.rb +0 -67
- data/lib/cucumber_analytics/parsed_scenario_outline.rb +0 -122
- data/spec/background_spec.rb +0 -23
- data/spec/directory_spec.rb +0 -18
- data/spec/example_spec.rb +0 -37
- data/spec/file_spec.rb +0 -20
- data/spec/outline_spec.rb +0 -32
- data/spec/scenario_spec.rb +0 -33
- data/spec/step_spec.rb +0 -24
checksums.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
ZDdiMjBmYjRjNzY3ODM2MDNlYzQzNDRhZmZjOWM4YmI0MTQ1ZDFmZg==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
MTAyOTE4MzQzYjUyMjM1MDY1NmYzMjBiYzg1OTE0NWViMjQ3NzAxMQ==
|
|
7
|
+
!binary "U0hBNTEy":
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
YmE1OWU5N2QwNzRjZjQ2NzExN2NlM2Q3ZGQ2NjY5YjlkMWE3M2JiODgyNmNh
|
|
10
|
+
MjQ4NTQ0ZmUwMWNjZmQwNWM0ODNlMjdiZTJjMGY3MjdmZGY1M2Y3ZTQ3YmIw
|
|
11
|
+
MzkxNThhZmJjMjcwZmVlOTc2ODhmYWRlMThlNDUzNGY0ZTI4ZjU=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
NTBlYmU2MDAwNWUwMjA0MDRkZDdiMGY4NDk3MWU4YjYyNjkwYjYyZjc2YzJl
|
|
14
|
+
NDRmYTExZWYzY2U0YmI5MTZiYTRkNDNlYjg3MDUxNTJiZThjNGJlOWU2MDFl
|
|
15
|
+
MzdmZjJmMzUzOGYwY2U0MjlkODIwZGY1OTM0NzEzYjk0ZDA3NzQ=
|
data/History.rdoc
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
=== Version 1.0.0 / 2013-06-30
|
|
2
|
+
|
|
3
|
+
* Bug fix: Step definitions are now detected whether or not parenthesis are
|
|
4
|
+
used in the declararion.
|
|
5
|
+
* Now using the gherkin gem to parse feature files. This should eliminate most
|
|
6
|
+
parsing related bugs.
|
|
7
|
+
* Empty outline example blocks can non longer be handeled (since the gherkin gem
|
|
8
|
+
can likewise not handle them).
|
|
9
|
+
* Source code snippets can now be analyzed (rather than needing an entire feature
|
|
10
|
+
file to parse).
|
|
11
|
+
* Logging has been removed from the gem due to its significant negative impact
|
|
12
|
+
on performance.
|
|
13
|
+
* Many class and method names have changed.
|
|
14
|
+
* Significant API overhaul, including several new classes for modeling.
|
|
15
|
+
|
|
16
|
+
|
|
1
17
|
=== Version 0.0.9 / 2013-02-25
|
|
2
18
|
|
|
3
19
|
* Bug fix: Fixed an un-anchored regular expression that was causing
|
data/README.rdoc
CHANGED
|
@@ -39,7 +39,7 @@ First things first. Load up the gem code.
|
|
|
39
39
|
|
|
40
40
|
Next, let's generate a model for our Cucumber suite.
|
|
41
41
|
|
|
42
|
-
directory = CucumberAnalytics::
|
|
42
|
+
directory = CucumberAnalytics::Directory.new('path/to/the/code_directory')
|
|
43
43
|
world = CucumberAnalytics::World
|
|
44
44
|
|
|
45
45
|
Now it's time to take a look around and see what we can see.
|
|
@@ -58,8 +58,8 @@ Now it's time to take a look around and see what we can see.
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
all_steps = world.steps_in(directory)
|
|
61
|
-
puts all_steps.collect{ |step| step.
|
|
62
|
-
#=> ["some step", "the user logs in", "the user will log in", "another step", "the user "Bob" logs in"]
|
|
61
|
+
puts all_steps.collect{ |step| step.base}
|
|
62
|
+
#=> ["some step", "the user logs in", "the user will log in", "another step", "the user \"Bob\" logs in"]
|
|
63
63
|
|
|
64
64
|
So with a few simple commands we have discovered that there are five different
|
|
65
65
|
tags in our codebase and that @wip tags account for half of all usages. We have
|
|
@@ -74,3 +74,5 @@ rewritten into a single, reusable step.
|
|
|
74
74
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
|
75
75
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
76
76
|
5. Create new Pull Request
|
|
77
|
+
|
|
78
|
+
I'm always looking for new ways to poke at a testbase. Feature requests are welcome.
|
data/Rakefile
CHANGED
|
@@ -4,11 +4,16 @@ require 'cucumber/rake/task'
|
|
|
4
4
|
require 'rspec/core/rake_task'
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
desc 'Run all acceptance tests for the gem'
|
|
9
8
|
Cucumber::Rake::Task.new(:tests)
|
|
10
9
|
|
|
11
10
|
desc 'Run all API specifications for the gem'
|
|
12
11
|
RSpec::Core::RakeTask.new(:specs)
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
desc 'Run All The Things'
|
|
14
|
+
task :everything do
|
|
15
|
+
Rake::Task[:specs].invoke
|
|
16
|
+
Rake::Task[:tests].invoke
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
task :default => :everything
|
data/cucumber_analytics.gemspec
CHANGED
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
require File.expand_path('../lib/cucumber_analytics/version', __FILE__)
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |gem|
|
|
5
|
-
gem.authors = [
|
|
6
|
-
gem.email = [
|
|
5
|
+
gem.authors = ['Eric Kessler']
|
|
6
|
+
gem.email = ['morrow748@gmail.com']
|
|
7
7
|
gem.description = %q{Static analysis of Cucumber tests made easy.}
|
|
8
8
|
gem.summary = %q{This gem provides an API to programmatically break down Cucumber feature files so that they can be inspected and analyzed in a straightforward manner.}
|
|
9
|
-
gem.homepage =
|
|
9
|
+
gem.homepage = 'https://github.com/enkessler/cucumber_analytics'
|
|
10
10
|
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
14
|
-
gem.name =
|
|
15
|
-
gem.require_paths = [
|
|
14
|
+
gem.name = 'cucumber_analytics'
|
|
15
|
+
gem.require_paths = ['lib']
|
|
16
16
|
gem.version = CucumberAnalytics::VERSION
|
|
17
17
|
|
|
18
|
+
gem.add_runtime_dependency('gherkin')
|
|
19
|
+
|
|
18
20
|
gem.add_development_dependency('rake')
|
|
19
21
|
gem.add_development_dependency('cucumber')
|
|
20
22
|
gem.add_development_dependency('rspec')
|
|
@@ -61,77 +61,76 @@ Feature: Steps can be collected from arbitrary parts of the codebase.
|
|
|
61
61
|
And the directory "feature_directory" is read
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
|
|
65
64
|
Scenario: Steps can be collected from backgrounds
|
|
66
65
|
Then the steps collected from feature "1" background are as follows:
|
|
67
|
-
|
|
|
68
|
-
|
|
|
66
|
+
| a defined step |
|
|
67
|
+
| an undefined step |
|
|
69
68
|
And the "defined" steps collected from feature "1" background are as follows:
|
|
70
|
-
|
|
|
69
|
+
| a defined step |
|
|
71
70
|
And the "undefined" steps collected from feature "1" background are as follows:
|
|
72
|
-
|
|
|
71
|
+
| an undefined step |
|
|
73
72
|
|
|
74
73
|
Scenario: Steps can be collected from scenarios
|
|
75
74
|
Then the steps collected from feature "1" test "1" are as follows:
|
|
76
|
-
|
|
|
77
|
-
|
|
|
75
|
+
| another defined step |
|
|
76
|
+
| another undefined step |
|
|
78
77
|
And the "defined" steps collected from feature "1" test "1" are as follows:
|
|
79
|
-
|
|
|
78
|
+
| another defined step |
|
|
80
79
|
And the "undefined" steps collected from feature "1" test "1" are as follows:
|
|
81
|
-
|
|
|
80
|
+
| another undefined step |
|
|
82
81
|
|
|
83
82
|
Scenario: Steps can be collected from scenario outlines
|
|
84
83
|
Then the steps collected from feature "2" test "1" are as follows:
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
84
|
+
| a defined step |
|
|
85
|
+
| another defined step |
|
|
86
|
+
| *<this>* *step is* *<undefined>* |
|
|
88
87
|
And the "defined" steps collected from feature "2" test "1" are as follows:
|
|
89
|
-
|
|
|
90
|
-
|
|
|
88
|
+
| a defined step |
|
|
89
|
+
| another defined step |
|
|
91
90
|
And the "undefined" steps collected from feature "2" test "1" are as follows:
|
|
92
|
-
|
|
|
91
|
+
| *<this>* *step is* *<undefined>* |
|
|
93
92
|
|
|
94
93
|
Scenario: Steps can be collected from features
|
|
95
94
|
Then the steps collected from feature "1" are as follows:
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
95
|
+
| a defined step |
|
|
96
|
+
| an undefined step |
|
|
97
|
+
| another defined step |
|
|
98
|
+
| another undefined step |
|
|
100
99
|
And the "defined" steps collected from feature "1" are as follows:
|
|
101
|
-
|
|
|
102
|
-
|
|
|
100
|
+
| a defined step |
|
|
101
|
+
| another defined step |
|
|
103
102
|
And the "undefined" steps collected from feature "1" are as follows:
|
|
104
|
-
|
|
|
105
|
-
|
|
|
103
|
+
| an undefined step |
|
|
104
|
+
| another undefined step |
|
|
106
105
|
|
|
107
106
|
Scenario: Steps can be collected from files
|
|
108
107
|
Then the steps collected from file "1" are as follows:
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
108
|
+
| a defined step |
|
|
109
|
+
| an undefined step |
|
|
110
|
+
| another defined step |
|
|
111
|
+
| another undefined step |
|
|
113
112
|
And the "defined" steps collected from file "1" are as follows:
|
|
114
|
-
|
|
|
115
|
-
|
|
|
113
|
+
| a defined step |
|
|
114
|
+
| another defined step |
|
|
116
115
|
And the "undefined" steps collected from file "1" are as follows:
|
|
117
|
-
|
|
|
118
|
-
|
|
|
116
|
+
| an undefined step |
|
|
117
|
+
| another undefined step |
|
|
119
118
|
|
|
120
119
|
Scenario: Steps can be collected from directories
|
|
121
120
|
Then the steps collected from the directory are as follows:
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
121
|
+
| a defined step |
|
|
122
|
+
| an undefined step |
|
|
123
|
+
| another defined step |
|
|
124
|
+
| another undefined step |
|
|
125
|
+
| a defined step |
|
|
126
|
+
| another defined step |
|
|
127
|
+
| *<this>* *step is* *<undefined>* |
|
|
129
128
|
And the "defined" steps collected from the directory are as follows:
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
129
|
+
| a defined step |
|
|
130
|
+
| another defined step |
|
|
131
|
+
| a defined step |
|
|
132
|
+
| another defined step |
|
|
134
133
|
And the "undefined" steps collected from the directory are as follows:
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
134
|
+
| an undefined step |
|
|
135
|
+
| another undefined step |
|
|
136
|
+
| *<this>* *step is* *<undefined>* |
|
|
@@ -11,55 +11,15 @@ Feature: Background elements can be modeled.
|
|
|
11
11
|
Background: Test file setup.
|
|
12
12
|
Given the following feature file:
|
|
13
13
|
"""
|
|
14
|
-
Feature:
|
|
15
|
-
Some more feature description.
|
|
14
|
+
Feature:
|
|
16
15
|
|
|
17
16
|
Background:Some general test setup stuff.
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
Some background description
|
|
18
|
+
Some more description
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Background
|
|
25
|
-
this is still one big valid description
|
|
26
|
-
# Basically, if it's not a step keyword or tag then I will accept
|
|
27
|
-
# it as description here. Cucumber might not but but that's between
|
|
28
|
-
# you and its lexxer/parser. ;)
|
|
29
|
-
Given this *parameterized* step takes a table:
|
|
30
|
-
| data |
|
|
31
|
-
| more data |
|
|
32
|
-
When some setup step
|
|
33
|
-
But some setup step
|
|
34
|
-
#
|
|
35
|
-
Then a step with a *parameter*
|
|
36
|
-
And some big setup step:
|
|
37
|
-
#random comment
|
|
38
|
-
\"\"\"
|
|
39
|
-
some text
|
|
40
|
-
|
|
41
|
-
#some comments
|
|
42
|
-
Scenario:
|
|
43
|
-
Scenario Outline:
|
|
44
|
-
Examples:
|
|
45
|
-
@
|
|
46
|
-
Feature:
|
|
47
|
-
|
|
|
48
|
-
Given
|
|
49
|
-
When
|
|
50
|
-
Then
|
|
51
|
-
And
|
|
52
|
-
But
|
|
53
|
-
*
|
|
54
|
-
some more text
|
|
55
|
-
\"\"\"
|
|
56
|
-
* *lots* *of* *parameters*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Scenario: The first scenario's name.
|
|
60
|
-
Given the first step
|
|
61
|
-
When the second step
|
|
62
|
-
Then the third step
|
|
20
|
+
Given a setup step
|
|
21
|
+
And another setup step
|
|
22
|
+
When an action step
|
|
63
23
|
"""
|
|
64
24
|
And parameter delimiters of "*" and "*"
|
|
65
25
|
When the file is read
|
|
@@ -71,105 +31,14 @@ Feature: Background elements can be modeled.
|
|
|
71
31
|
|
|
72
32
|
Scenario: The background description is modeled.
|
|
73
33
|
Then the background's descriptive lines are as follows:
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
| Scenario Outline |
|
|
77
|
-
| Examples |
|
|
78
|
-
| """ |
|
|
79
|
-
| Background |
|
|
80
|
-
| this is still one big valid description |
|
|
34
|
+
| Some background description |
|
|
35
|
+
| Some more description |
|
|
81
36
|
|
|
82
37
|
Scenario: The background steps are modeled.
|
|
83
38
|
Then the background's steps are as follows:
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
| When some setup step |
|
|
88
|
-
| But some setup step |
|
|
89
|
-
| Then a step with a *parameter* |
|
|
90
|
-
| And some big setup step: |
|
|
91
|
-
| """ |
|
|
92
|
-
| 'some text' |
|
|
93
|
-
| '' |
|
|
94
|
-
| '#some comments' |
|
|
95
|
-
| 'Scenario:' |
|
|
96
|
-
| 'Scenario Outline:' |
|
|
97
|
-
| 'Examples:' |
|
|
98
|
-
| '@' |
|
|
99
|
-
| 'Feature:' |
|
|
100
|
-
| '\|' |
|
|
101
|
-
| 'Given' |
|
|
102
|
-
| 'When' |
|
|
103
|
-
| 'Then' |
|
|
104
|
-
| 'And' |
|
|
105
|
-
| 'But' |
|
|
106
|
-
| '*' |
|
|
107
|
-
| ' some more text' |
|
|
108
|
-
| """ |
|
|
109
|
-
| * *lots* *of* *parameters* |
|
|
110
|
-
And the background's steps "without" arguments are as follows:
|
|
111
|
-
| Given this ** step takes a table: |
|
|
112
|
-
| When some setup step |
|
|
113
|
-
| But some setup step |
|
|
114
|
-
| Then a step with a ** |
|
|
115
|
-
| And some big setup step: |
|
|
116
|
-
| * ** ** ** |
|
|
117
|
-
And the background's steps "without" keywords are as follows:
|
|
118
|
-
| this *parameterized* step takes a table: |
|
|
119
|
-
| \| data \| |
|
|
120
|
-
| \| more data \| |
|
|
121
|
-
| some setup step |
|
|
122
|
-
| some setup step |
|
|
123
|
-
| a step with a *parameter* |
|
|
124
|
-
| some big setup step: |
|
|
125
|
-
| """ |
|
|
126
|
-
| 'some text' |
|
|
127
|
-
| '' |
|
|
128
|
-
| '#some comments' |
|
|
129
|
-
| 'Scenario:' |
|
|
130
|
-
| 'Scenario Outline:' |
|
|
131
|
-
| 'Examples:' |
|
|
132
|
-
| '@' |
|
|
133
|
-
| 'Feature:' |
|
|
134
|
-
| '\|' |
|
|
135
|
-
| 'Given' |
|
|
136
|
-
| 'When' |
|
|
137
|
-
| 'Then' |
|
|
138
|
-
| 'And' |
|
|
139
|
-
| 'But' |
|
|
140
|
-
| '*' |
|
|
141
|
-
| ' some more text' |
|
|
142
|
-
| """ |
|
|
143
|
-
| *lots* *of* *parameters* |
|
|
144
|
-
And the background's steps "without" arguments "without" keywords are as follows:
|
|
145
|
-
| this ** step takes a table: |
|
|
146
|
-
| some setup step |
|
|
147
|
-
| some setup step |
|
|
148
|
-
| a step with a ** |
|
|
149
|
-
| some big setup step: |
|
|
150
|
-
| ** ** ** |
|
|
151
|
-
And step "1" of the background has the following block:
|
|
152
|
-
| \| data \| |
|
|
153
|
-
| \| more data \| |
|
|
154
|
-
And step "5" of the background has the following block:
|
|
155
|
-
| """ |
|
|
156
|
-
| 'some text' |
|
|
157
|
-
| '' |
|
|
158
|
-
| '#some comments' |
|
|
159
|
-
| 'Scenario:' |
|
|
160
|
-
| 'Scenario Outline:' |
|
|
161
|
-
| 'Examples:' |
|
|
162
|
-
| '@' |
|
|
163
|
-
| 'Feature:' |
|
|
164
|
-
| '\|' |
|
|
165
|
-
| 'Given' |
|
|
166
|
-
| 'When' |
|
|
167
|
-
| 'Then' |
|
|
168
|
-
| 'And' |
|
|
169
|
-
| 'But' |
|
|
170
|
-
| '*' |
|
|
171
|
-
| ' some more text' |
|
|
172
|
-
| """ |
|
|
39
|
+
| a setup step |
|
|
40
|
+
| another setup step |
|
|
41
|
+
| an action step |
|
|
173
42
|
|
|
174
43
|
Scenario Outline: Background models pass all other specifications
|
|
175
44
|
Exact specifications detailing the API for Background models.
|
|
@@ -177,5 +46,6 @@ Feature: Background elements can be modeled.
|
|
|
177
46
|
When the corresponding unit tests are run
|
|
178
47
|
Then all of those specifications are met
|
|
179
48
|
Examples:
|
|
180
|
-
| additional specifications
|
|
181
|
-
|
|
|
49
|
+
| additional specifications |
|
|
50
|
+
| background_unit_spec.rb |
|
|
51
|
+
| background_integration_spec.rb |
|
|
@@ -109,5 +109,6 @@ Feature: Directories can be modeled.
|
|
|
109
109
|
When the corresponding unit tests are run
|
|
110
110
|
Then all of those specifications are met
|
|
111
111
|
Examples:
|
|
112
|
-
| additional specifications
|
|
113
|
-
|
|
|
112
|
+
| additional specifications |
|
|
113
|
+
| directory_unit_spec.rb |
|
|
114
|
+
| directory_integration_spec.rb |
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Feature: Doc String elements can be modeled.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Acceptance criteria
|
|
5
|
+
|
|
6
|
+
All conceptual pieces of a Doc String can be modeled:
|
|
7
|
+
1. the doc string's content type
|
|
8
|
+
2. the doc string's contents
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Background: Test file setup.
|
|
12
|
+
Given the following feature file:
|
|
13
|
+
"""
|
|
14
|
+
Feature:
|
|
15
|
+
|
|
16
|
+
Scenario:
|
|
17
|
+
* some wordy step:
|
|
18
|
+
\"\"\" content type
|
|
19
|
+
some text
|
|
20
|
+
some more text
|
|
21
|
+
\"\"\"
|
|
22
|
+
* some wordy step:
|
|
23
|
+
\"\"\"
|
|
24
|
+
\"\"\"
|
|
25
|
+
"""
|
|
26
|
+
When the file is read
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
Scenario: The doc string's content type is modeled.
|
|
30
|
+
Then the step "1" doc string content type is "content type"
|
|
31
|
+
And the step "2" doc string has no content type
|
|
32
|
+
|
|
33
|
+
Scenario: The doc string's contents are modeled.
|
|
34
|
+
Then the step "1" doc string has the following contents:
|
|
35
|
+
| 'some text' |
|
|
36
|
+
| ' some more text' |
|
|
37
|
+
And the step "2" doc string contents are empty
|
|
38
|
+
|
|
39
|
+
Scenario Outline: Doc String models pass all other specifications
|
|
40
|
+
Exact specifications detailing the API for Doc String models.
|
|
41
|
+
Given that there are "<additional specifications>" detailing models
|
|
42
|
+
When the corresponding unit tests are run
|
|
43
|
+
Then all of those specifications are met
|
|
44
|
+
Examples:
|
|
45
|
+
| additional specifications |
|
|
46
|
+
| doc_string_unit_spec.rb |
|
|
@@ -16,36 +16,23 @@ Feature: Example elements can be modeled.
|
|
|
16
16
|
Given the following feature file:
|
|
17
17
|
"""
|
|
18
18
|
@a_feature_level_tag
|
|
19
|
-
Feature:
|
|
19
|
+
Feature:
|
|
20
20
|
|
|
21
21
|
@outline_tag
|
|
22
|
-
Scenario Outline:
|
|
23
|
-
|
|
24
|
-
| <param1> |
|
|
25
|
-
| <param2> |
|
|
26
|
-
Then I don't really need another step
|
|
22
|
+
Scenario Outline:
|
|
23
|
+
* a step
|
|
27
24
|
|
|
28
|
-
Examples:text describing the significance of the examples
|
|
29
|
-
|
|
30
|
-
description
|
|
25
|
+
Examples: text describing the significance of the examples
|
|
26
|
+
Example description
|
|
27
|
+
more description
|
|
31
28
|
|param1| param2 | extra param |
|
|
32
|
-
#A more random comment
|
|
33
29
|
|x | y | ? |
|
|
34
30
|
|1 | 2 | 3 |
|
|
35
|
-
|
|
36
|
-
Examples:some examples with different significance and a tag
|
|
37
|
-
|
|
38
|
-
Words, words, words, words,
|
|
39
|
-
|
|
40
|
-
why so many words?
|
|
41
|
-
#
|
|
42
|
-
|
|
31
|
+
@example_tag @another_one
|
|
32
|
+
Examples: some examples with different significance and a tag
|
|
33
|
+
Description
|
|
43
34
|
| param1 |
|
|
44
|
-
#
|
|
45
|
-
|
|
46
|
-
#
|
|
47
35
|
| a |
|
|
48
|
-
Examples:
|
|
49
36
|
"""
|
|
50
37
|
And parameter delimiters of "*" and "*"
|
|
51
38
|
When the file is read
|
|
@@ -56,25 +43,19 @@ Feature: Example elements can be modeled.
|
|
|
56
43
|
| name | text describing the significance of the examples |
|
|
57
44
|
And the test example block "2" is found to have the following properties:
|
|
58
45
|
| name | some examples with different significance and a tag |
|
|
59
|
-
And the test example block "3" is found to have the following properties:
|
|
60
|
-
| name | |
|
|
61
|
-
|
|
62
46
|
|
|
63
47
|
Scenario: The examples' description is modeled.
|
|
64
48
|
Then the test example block "1" descriptive lines are as follows:
|
|
65
|
-
|
|
|
66
|
-
| description
|
|
49
|
+
| Example description |
|
|
50
|
+
| more description |
|
|
67
51
|
And the test example block "2" descriptive lines are as follows:
|
|
68
|
-
|
|
|
69
|
-
| why so many words? |
|
|
70
|
-
And the test example block "3" has no descriptive lines
|
|
52
|
+
| Description |
|
|
71
53
|
|
|
72
54
|
Scenario: The examples' tags are modeled.
|
|
73
55
|
Then the test example block "1" has no tags
|
|
74
56
|
And the test example block "2" is found to have the following tags:
|
|
75
57
|
| @example_tag |
|
|
76
58
|
| @another_one |
|
|
77
|
-
And the test example block "3" has no tags
|
|
78
59
|
|
|
79
60
|
Scenario: The examples' applied tags are modeled.
|
|
80
61
|
Then the test example block "2" is found to have the following applied tags:
|
|
@@ -88,7 +69,6 @@ Feature: Example elements can be modeled.
|
|
|
88
69
|
| extra param |
|
|
89
70
|
And the test example block "2" parameters are as follows:
|
|
90
71
|
| param1 |
|
|
91
|
-
And the test example block "3" has no parameters
|
|
92
72
|
|
|
93
73
|
Scenario: The examples' rows are modeled.
|
|
94
74
|
Then the test example block "1" rows are as follows:
|
|
@@ -96,7 +76,6 @@ Feature: Example elements can be modeled.
|
|
|
96
76
|
| 1,2,3 |
|
|
97
77
|
And the test example block "2" rows are as follows:
|
|
98
78
|
| a |
|
|
99
|
-
And the test example block "3" has no rows
|
|
100
79
|
|
|
101
80
|
Scenario Outline: Example models pass all other specifications
|
|
102
81
|
Exact specifications detailing the API for Examples models.
|
|
@@ -105,4 +84,4 @@ Feature: Example elements can be modeled.
|
|
|
105
84
|
Then all of those specifications are met
|
|
106
85
|
Examples:
|
|
107
86
|
| additional specifications |
|
|
108
|
-
|
|
|
87
|
+
| example_unit_spec.rb |
|
|
@@ -53,5 +53,6 @@ Feature: Feature files can be modeled.
|
|
|
53
53
|
When the corresponding unit tests are run
|
|
54
54
|
Then all of those specifications are met
|
|
55
55
|
Examples:
|
|
56
|
-
| additional specifications
|
|
57
|
-
|
|
|
56
|
+
| additional specifications |
|
|
57
|
+
| feature_file_unit_spec.rb |
|
|
58
|
+
| feature_file_integration_spec.rb |
|