cuke_modeler 3.27.0 → 3.28.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 +4 -4
- data/CHANGELOG.md +579 -572
- data/LICENSE.txt +22 -22
- data/README.md +135 -135
- data/cuke_modeler.gemspec +59 -59
- data/lib/cuke_modeler/adapters/gherkin_10_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_11_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_12_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_13_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_14_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_15_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_16_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_17_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_18_adapter.rb +27 -27
- data/lib/cuke_modeler/adapters/gherkin_19_adapter.rb +64 -64
- data/lib/cuke_modeler/adapters/gherkin_20_adapter.rb +359 -359
- data/lib/cuke_modeler/adapters/gherkin_21_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_22_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_23_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_24_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_25_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_26_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_27_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_28_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_29_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_30_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_31_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_32_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_33_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_34_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_35_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_36_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_37_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_38_adapter.rb +13 -0
- data/lib/cuke_modeler/adapters/gherkin_9_adapter.rb +375 -375
- data/lib/cuke_modeler/adapters/gherkin_base_adapter.rb +17 -17
- data/lib/cuke_modeler/containing.rb +105 -105
- data/lib/cuke_modeler/described.rb +71 -71
- data/lib/cuke_modeler/models/background.rb +122 -122
- data/lib/cuke_modeler/models/cell.rb +88 -88
- data/lib/cuke_modeler/models/comment.rb +82 -82
- data/lib/cuke_modeler/models/directory.rb +143 -143
- data/lib/cuke_modeler/models/doc_string.rb +104 -104
- data/lib/cuke_modeler/models/example.rb +274 -274
- data/lib/cuke_modeler/models/feature.rb +200 -200
- data/lib/cuke_modeler/models/feature_file.rb +116 -116
- data/lib/cuke_modeler/models/model.rb +87 -87
- data/lib/cuke_modeler/models/outline.rb +145 -145
- data/lib/cuke_modeler/models/row.rb +104 -104
- data/lib/cuke_modeler/models/rule.rb +162 -162
- data/lib/cuke_modeler/models/scenario.rb +128 -128
- data/lib/cuke_modeler/models/step.rb +178 -178
- data/lib/cuke_modeler/models/table.rb +117 -117
- data/lib/cuke_modeler/models/tag.rb +75 -75
- data/lib/cuke_modeler/named.rb +26 -26
- data/lib/cuke_modeler/nested.rb +61 -61
- data/lib/cuke_modeler/parsed.rb +24 -24
- data/lib/cuke_modeler/parsing.rb +208 -208
- data/lib/cuke_modeler/sourceable.rb +29 -29
- data/lib/cuke_modeler/stepped.rb +34 -34
- data/lib/cuke_modeler/taggable.rb +57 -57
- data/lib/cuke_modeler/version.rb +4 -4
- data/lib/cuke_modeler.rb +32 -32
- data/testing/cucumber/features/analysis/step_comparison.feature +25 -25
- data/testing/cucumber/features/analysis/test_comparison.feature +35 -35
- data/testing/cucumber/features/modeling/background_modeling.feature +105 -105
- data/testing/cucumber/features/modeling/background_output.feature +60 -60
- data/testing/cucumber/features/modeling/cell_modeling.feature +68 -68
- data/testing/cucumber/features/modeling/cell_output.feature +36 -36
- data/testing/cucumber/features/modeling/comment_modeling.feature +62 -62
- data/testing/cucumber/features/modeling/comment_output.feature +40 -40
- data/testing/cucumber/features/modeling/directory_modeling.feature +62 -62
- data/testing/cucumber/features/modeling/directory_output.feature +33 -33
- data/testing/cucumber/features/modeling/doc_string_modeling.feature +85 -85
- data/testing/cucumber/features/modeling/doc_string_output.feature +50 -50
- data/testing/cucumber/features/modeling/example_modeling.feature +155 -155
- data/testing/cucumber/features/modeling/example_output.feature +57 -57
- data/testing/cucumber/features/modeling/feature_file_modeling.feature +49 -49
- data/testing/cucumber/features/modeling/feature_file_output.feature +33 -33
- data/testing/cucumber/features/modeling/feature_modeling.feature +149 -149
- data/testing/cucumber/features/modeling/feature_output.feature +144 -144
- data/testing/cucumber/features/modeling/model_output.feature +61 -61
- data/testing/cucumber/features/modeling/model_structure.feature +42 -42
- data/testing/cucumber/features/modeling/outline_modeling.feature +175 -175
- data/testing/cucumber/features/modeling/outline_output.feature +87 -87
- data/testing/cucumber/features/modeling/row_modeling.feature +70 -70
- data/testing/cucumber/features/modeling/row_output.feature +40 -40
- data/testing/cucumber/features/modeling/rule_modeling.feature +171 -171
- data/testing/cucumber/features/modeling/rule_output.feature +136 -136
- data/testing/cucumber/features/modeling/scenario_modeling.feature +146 -146
- data/testing/cucumber/features/modeling/scenario_output.feature +63 -63
- data/testing/cucumber/features/modeling/step_modeling.feature +105 -105
- data/testing/cucumber/features/modeling/step_output.feature +47 -47
- data/testing/cucumber/features/modeling/table_modeling.feature +73 -73
- data/testing/cucumber/features/modeling/table_output.feature +42 -42
- data/testing/cucumber/features/modeling/tag_modeling.feature +62 -62
- data/testing/cucumber/features/modeling/tag_output.feature +40 -40
- metadata +6 -8
data/lib/cuke_modeler.rb
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
# The top level namespace used by this gem
|
|
2
|
-
module CukeModeler
|
|
3
|
-
end
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
require 'cuke_modeler/version'
|
|
7
|
-
|
|
8
|
-
require 'cuke_modeler/parsing'
|
|
9
|
-
require 'cuke_modeler/containing'
|
|
10
|
-
require 'cuke_modeler/taggable'
|
|
11
|
-
require 'cuke_modeler/parsed'
|
|
12
|
-
require 'cuke_modeler/sourceable'
|
|
13
|
-
require 'cuke_modeler/nested'
|
|
14
|
-
require 'cuke_modeler/named'
|
|
15
|
-
require 'cuke_modeler/described'
|
|
16
|
-
require 'cuke_modeler/stepped'
|
|
17
|
-
require 'cuke_modeler/models/model'
|
|
18
|
-
require 'cuke_modeler/models/feature_file'
|
|
19
|
-
require 'cuke_modeler/models/directory'
|
|
20
|
-
require 'cuke_modeler/models/feature'
|
|
21
|
-
require 'cuke_modeler/models/rule'
|
|
22
|
-
require 'cuke_modeler/models/background'
|
|
23
|
-
require 'cuke_modeler/models/scenario'
|
|
24
|
-
require 'cuke_modeler/models/outline'
|
|
25
|
-
require 'cuke_modeler/models/example'
|
|
26
|
-
require 'cuke_modeler/models/step'
|
|
27
|
-
require 'cuke_modeler/models/doc_string'
|
|
28
|
-
require 'cuke_modeler/models/table'
|
|
29
|
-
require 'cuke_modeler/models/row'
|
|
30
|
-
require 'cuke_modeler/models/tag'
|
|
31
|
-
require 'cuke_modeler/models/cell'
|
|
32
|
-
require 'cuke_modeler/models/comment'
|
|
1
|
+
# The top level namespace used by this gem
|
|
2
|
+
module CukeModeler
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
require 'cuke_modeler/version'
|
|
7
|
+
|
|
8
|
+
require 'cuke_modeler/parsing'
|
|
9
|
+
require 'cuke_modeler/containing'
|
|
10
|
+
require 'cuke_modeler/taggable'
|
|
11
|
+
require 'cuke_modeler/parsed'
|
|
12
|
+
require 'cuke_modeler/sourceable'
|
|
13
|
+
require 'cuke_modeler/nested'
|
|
14
|
+
require 'cuke_modeler/named'
|
|
15
|
+
require 'cuke_modeler/described'
|
|
16
|
+
require 'cuke_modeler/stepped'
|
|
17
|
+
require 'cuke_modeler/models/model'
|
|
18
|
+
require 'cuke_modeler/models/feature_file'
|
|
19
|
+
require 'cuke_modeler/models/directory'
|
|
20
|
+
require 'cuke_modeler/models/feature'
|
|
21
|
+
require 'cuke_modeler/models/rule'
|
|
22
|
+
require 'cuke_modeler/models/background'
|
|
23
|
+
require 'cuke_modeler/models/scenario'
|
|
24
|
+
require 'cuke_modeler/models/outline'
|
|
25
|
+
require 'cuke_modeler/models/example'
|
|
26
|
+
require 'cuke_modeler/models/step'
|
|
27
|
+
require 'cuke_modeler/models/doc_string'
|
|
28
|
+
require 'cuke_modeler/models/table'
|
|
29
|
+
require 'cuke_modeler/models/row'
|
|
30
|
+
require 'cuke_modeler/models/tag'
|
|
31
|
+
require 'cuke_modeler/models/cell'
|
|
32
|
+
require 'cuke_modeler/models/comment'
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
Feature: Step comparison
|
|
2
|
-
|
|
3
|
-
Step comparison using `==` is done based on 'significant' properties. Keywords, being completely interchangeable, do not affect step equality.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Scenario: Comparison of steps
|
|
7
|
-
Given a model for the following step:
|
|
8
|
-
"""
|
|
9
|
-
Given a step
|
|
10
|
-
"""
|
|
11
|
-
And a model for the following step:
|
|
12
|
-
"""
|
|
13
|
-
When a step
|
|
14
|
-
"""
|
|
15
|
-
And a model for the following step:
|
|
16
|
-
"""
|
|
17
|
-
Then a step
|
|
18
|
-
"""
|
|
19
|
-
When the models are compared
|
|
20
|
-
Then all of them are equivalent
|
|
21
|
-
But none of the models are equivalent with a model for the following step:
|
|
22
|
-
"""
|
|
23
|
-
And a step
|
|
24
|
-
| plus this table |
|
|
25
|
-
"""
|
|
1
|
+
Feature: Step comparison
|
|
2
|
+
|
|
3
|
+
Step comparison using `==` is done based on 'significant' properties. Keywords, being completely interchangeable, do not affect step equality.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Scenario: Comparison of steps
|
|
7
|
+
Given a model for the following step:
|
|
8
|
+
"""
|
|
9
|
+
Given a step
|
|
10
|
+
"""
|
|
11
|
+
And a model for the following step:
|
|
12
|
+
"""
|
|
13
|
+
When a step
|
|
14
|
+
"""
|
|
15
|
+
And a model for the following step:
|
|
16
|
+
"""
|
|
17
|
+
Then a step
|
|
18
|
+
"""
|
|
19
|
+
When the models are compared
|
|
20
|
+
Then all of them are equivalent
|
|
21
|
+
But none of the models are equivalent with a model for the following step:
|
|
22
|
+
"""
|
|
23
|
+
And a step
|
|
24
|
+
| plus this table |
|
|
25
|
+
"""
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
Feature: Test comparison
|
|
2
|
-
|
|
3
|
-
Gherkin elements that contain steps (i.e. backgrounds, scenarios, and outlines) can be compared with one another in order to determine equality. Elements are considered equal if their steps match (see step comparison). Properties that do not affect what a test *does* (e.g. name, description, tags) are ignored for the purposes of comparison.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Scenario: Comparing tests
|
|
7
|
-
Given a model for the following background:
|
|
8
|
-
"""
|
|
9
|
-
Background:
|
|
10
|
-
* step 1
|
|
11
|
-
* step 2
|
|
12
|
-
"""
|
|
13
|
-
And a model for the following scenario:
|
|
14
|
-
"""
|
|
15
|
-
Scenario:
|
|
16
|
-
* step 1
|
|
17
|
-
* step 2
|
|
18
|
-
"""
|
|
19
|
-
And a model for the following outline:
|
|
20
|
-
"""
|
|
21
|
-
Scenario Outline:
|
|
22
|
-
* step 1
|
|
23
|
-
* step 2
|
|
24
|
-
Examples:
|
|
25
|
-
| param |
|
|
26
|
-
| value |
|
|
27
|
-
"""
|
|
28
|
-
When the models are compared
|
|
29
|
-
Then all of them are equivalent
|
|
30
|
-
But none of the models are equivalent with a model for the following scenario:
|
|
31
|
-
"""
|
|
32
|
-
Scenario:
|
|
33
|
-
* step 1
|
|
34
|
-
* step 3
|
|
35
|
-
"""
|
|
1
|
+
Feature: Test comparison
|
|
2
|
+
|
|
3
|
+
Gherkin elements that contain steps (i.e. backgrounds, scenarios, and outlines) can be compared with one another in order to determine equality. Elements are considered equal if their steps match (see step comparison). Properties that do not affect what a test *does* (e.g. name, description, tags) are ignored for the purposes of comparison.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Scenario: Comparing tests
|
|
7
|
+
Given a model for the following background:
|
|
8
|
+
"""
|
|
9
|
+
Background:
|
|
10
|
+
* step 1
|
|
11
|
+
* step 2
|
|
12
|
+
"""
|
|
13
|
+
And a model for the following scenario:
|
|
14
|
+
"""
|
|
15
|
+
Scenario:
|
|
16
|
+
* step 1
|
|
17
|
+
* step 2
|
|
18
|
+
"""
|
|
19
|
+
And a model for the following outline:
|
|
20
|
+
"""
|
|
21
|
+
Scenario Outline:
|
|
22
|
+
* step 1
|
|
23
|
+
* step 2
|
|
24
|
+
Examples:
|
|
25
|
+
| param |
|
|
26
|
+
| value |
|
|
27
|
+
"""
|
|
28
|
+
When the models are compared
|
|
29
|
+
Then all of them are equivalent
|
|
30
|
+
But none of the models are equivalent with a model for the following scenario:
|
|
31
|
+
"""
|
|
32
|
+
Scenario:
|
|
33
|
+
* step 1
|
|
34
|
+
* step 3
|
|
35
|
+
"""
|
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
Feature: Background modeling
|
|
2
|
-
|
|
3
|
-
Background models represent the Background portion of a feature. They expose several attributes of the background that they represent, as well as containing models for the steps that are present in that background.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Background:
|
|
7
|
-
Given the following gherkin:
|
|
8
|
-
"""
|
|
9
|
-
Background: Some general test setup stuff.
|
|
10
|
-
|
|
11
|
-
Some background description.
|
|
12
|
-
|
|
13
|
-
Some more.
|
|
14
|
-
Even more.
|
|
15
|
-
|
|
16
|
-
Given a setup step
|
|
17
|
-
And another setup step
|
|
18
|
-
When an action step
|
|
19
|
-
"""
|
|
20
|
-
And a background model based on that gherkin
|
|
21
|
-
"""
|
|
22
|
-
@model = CukeModeler::Background.new(<source_text>)
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Scenario: Modeling a background's keyword
|
|
27
|
-
When the backgrounds's keyword is requested
|
|
28
|
-
"""
|
|
29
|
-
@model.keyword
|
|
30
|
-
"""
|
|
31
|
-
Then the model returns "Background"
|
|
32
|
-
|
|
33
|
-
Scenario: Modeling a background's name
|
|
34
|
-
When the background's name is requested
|
|
35
|
-
"""
|
|
36
|
-
@model.name
|
|
37
|
-
"""
|
|
38
|
-
Then the model returns "Some general test setup stuff."
|
|
39
|
-
|
|
40
|
-
Scenario: Modeling a background's description
|
|
41
|
-
When the background's description is requested
|
|
42
|
-
"""
|
|
43
|
-
@model.description
|
|
44
|
-
"""
|
|
45
|
-
Then the model returns
|
|
46
|
-
"""
|
|
47
|
-
Some background description.
|
|
48
|
-
|
|
49
|
-
Some more.
|
|
50
|
-
Even more.
|
|
51
|
-
"""
|
|
52
|
-
|
|
53
|
-
Scenario: Modeling a background's steps
|
|
54
|
-
When the background's steps are requested
|
|
55
|
-
"""
|
|
56
|
-
@model.steps
|
|
57
|
-
"""
|
|
58
|
-
Then the model returns models for the following steps:
|
|
59
|
-
| a setup step |
|
|
60
|
-
| another setup step |
|
|
61
|
-
| an action step |
|
|
62
|
-
|
|
63
|
-
Scenario: Modeling a background's source line
|
|
64
|
-
Given the following gherkin:
|
|
65
|
-
"""
|
|
66
|
-
Feature:
|
|
67
|
-
|
|
68
|
-
Background:
|
|
69
|
-
* a step
|
|
70
|
-
"""
|
|
71
|
-
And a feature model based on that gherkin
|
|
72
|
-
"""
|
|
73
|
-
@model = CukeModeler::Feature.new(<source_text>)
|
|
74
|
-
"""
|
|
75
|
-
And the background model of that feature model
|
|
76
|
-
"""
|
|
77
|
-
@model = @model.background
|
|
78
|
-
"""
|
|
79
|
-
When the background's source line is requested
|
|
80
|
-
"""
|
|
81
|
-
@model.source_line
|
|
82
|
-
"""
|
|
83
|
-
Then the model returns "3"
|
|
84
|
-
|
|
85
|
-
Scenario: Modeling a background's source column
|
|
86
|
-
Given the following gherkin:
|
|
87
|
-
"""
|
|
88
|
-
Feature:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Background:
|
|
92
|
-
* a step
|
|
93
|
-
"""
|
|
94
|
-
And a feature model based on that gherkin
|
|
95
|
-
"""
|
|
96
|
-
@model = CukeModeler::Feature.new(<source_text>)
|
|
97
|
-
"""
|
|
98
|
-
And the background model of that feature model
|
|
99
|
-
"""
|
|
100
|
-
@model = @model.background
|
|
101
|
-
"""
|
|
102
|
-
When the background's source column is requested
|
|
103
|
-
"""
|
|
104
|
-
@model.source_column
|
|
105
|
-
"""
|
|
1
|
+
Feature: Background modeling
|
|
2
|
+
|
|
3
|
+
Background models represent the Background portion of a feature. They expose several attributes of the background that they represent, as well as containing models for the steps that are present in that background.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Background:
|
|
7
|
+
Given the following gherkin:
|
|
8
|
+
"""
|
|
9
|
+
Background: Some general test setup stuff.
|
|
10
|
+
|
|
11
|
+
Some background description.
|
|
12
|
+
|
|
13
|
+
Some more.
|
|
14
|
+
Even more.
|
|
15
|
+
|
|
16
|
+
Given a setup step
|
|
17
|
+
And another setup step
|
|
18
|
+
When an action step
|
|
19
|
+
"""
|
|
20
|
+
And a background model based on that gherkin
|
|
21
|
+
"""
|
|
22
|
+
@model = CukeModeler::Background.new(<source_text>)
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
Scenario: Modeling a background's keyword
|
|
27
|
+
When the backgrounds's keyword is requested
|
|
28
|
+
"""
|
|
29
|
+
@model.keyword
|
|
30
|
+
"""
|
|
31
|
+
Then the model returns "Background"
|
|
32
|
+
|
|
33
|
+
Scenario: Modeling a background's name
|
|
34
|
+
When the background's name is requested
|
|
35
|
+
"""
|
|
36
|
+
@model.name
|
|
37
|
+
"""
|
|
38
|
+
Then the model returns "Some general test setup stuff."
|
|
39
|
+
|
|
40
|
+
Scenario: Modeling a background's description
|
|
41
|
+
When the background's description is requested
|
|
42
|
+
"""
|
|
43
|
+
@model.description
|
|
44
|
+
"""
|
|
45
|
+
Then the model returns
|
|
46
|
+
"""
|
|
47
|
+
Some background description.
|
|
48
|
+
|
|
49
|
+
Some more.
|
|
50
|
+
Even more.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
Scenario: Modeling a background's steps
|
|
54
|
+
When the background's steps are requested
|
|
55
|
+
"""
|
|
56
|
+
@model.steps
|
|
57
|
+
"""
|
|
58
|
+
Then the model returns models for the following steps:
|
|
59
|
+
| a setup step |
|
|
60
|
+
| another setup step |
|
|
61
|
+
| an action step |
|
|
62
|
+
|
|
63
|
+
Scenario: Modeling a background's source line
|
|
64
|
+
Given the following gherkin:
|
|
65
|
+
"""
|
|
66
|
+
Feature:
|
|
67
|
+
|
|
68
|
+
Background:
|
|
69
|
+
* a step
|
|
70
|
+
"""
|
|
71
|
+
And a feature model based on that gherkin
|
|
72
|
+
"""
|
|
73
|
+
@model = CukeModeler::Feature.new(<source_text>)
|
|
74
|
+
"""
|
|
75
|
+
And the background model of that feature model
|
|
76
|
+
"""
|
|
77
|
+
@model = @model.background
|
|
78
|
+
"""
|
|
79
|
+
When the background's source line is requested
|
|
80
|
+
"""
|
|
81
|
+
@model.source_line
|
|
82
|
+
"""
|
|
83
|
+
Then the model returns "3"
|
|
84
|
+
|
|
85
|
+
Scenario: Modeling a background's source column
|
|
86
|
+
Given the following gherkin:
|
|
87
|
+
"""
|
|
88
|
+
Feature:
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
Background:
|
|
92
|
+
* a step
|
|
93
|
+
"""
|
|
94
|
+
And a feature model based on that gherkin
|
|
95
|
+
"""
|
|
96
|
+
@model = CukeModeler::Feature.new(<source_text>)
|
|
97
|
+
"""
|
|
98
|
+
And the background model of that feature model
|
|
99
|
+
"""
|
|
100
|
+
@model = @model.background
|
|
101
|
+
"""
|
|
102
|
+
When the background's source column is requested
|
|
103
|
+
"""
|
|
104
|
+
@model.source_column
|
|
105
|
+
"""
|
|
106
106
|
Then the model returns "3"
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
Feature: Background output
|
|
2
|
-
|
|
3
|
-
A background model's string output is a Gherkin representation of itself and its most relevant attribute for
|
|
4
|
-
inspection is the name of the background that it models.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Background:
|
|
8
|
-
Given the following gherkin:
|
|
9
|
-
"""
|
|
10
|
-
Background: A background with everything that it could have
|
|
11
|
-
|
|
12
|
-
Including a description
|
|
13
|
-
and then some.
|
|
14
|
-
|
|
15
|
-
* a step
|
|
16
|
-
|value|
|
|
17
|
-
* another step
|
|
18
|
-
\"\"\"
|
|
19
|
-
some string
|
|
20
|
-
\"\"\"
|
|
21
|
-
"""
|
|
22
|
-
And a background model based on that gherkin
|
|
23
|
-
"""
|
|
24
|
-
@model = CukeModeler::Background.new(<source_text>)
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Scenario: Stringify a background model
|
|
29
|
-
When the model is output as a string
|
|
30
|
-
"""
|
|
31
|
-
@model.to_s
|
|
32
|
-
"""
|
|
33
|
-
Then the following text is provided:
|
|
34
|
-
"""
|
|
35
|
-
Background: A background with everything that it could have
|
|
36
|
-
|
|
37
|
-
Including a description
|
|
38
|
-
and then some.
|
|
39
|
-
|
|
40
|
-
* a step
|
|
41
|
-
| value |
|
|
42
|
-
* another step
|
|
43
|
-
\"\"\"
|
|
44
|
-
some string
|
|
45
|
-
\"\"\"
|
|
46
|
-
"""
|
|
47
|
-
And the output can be used to make an equivalent model
|
|
48
|
-
"""
|
|
49
|
-
CukeModeler::Background.new(@model.to_s)
|
|
50
|
-
"""
|
|
51
|
-
|
|
52
|
-
Scenario: Inspect a background model
|
|
53
|
-
When the model is inspected
|
|
54
|
-
"""
|
|
55
|
-
@model.inspect
|
|
56
|
-
"""
|
|
57
|
-
Then the following text is provided:
|
|
58
|
-
"""
|
|
59
|
-
#<CukeModeler::Background:<object_id> @name: "A background with everything that it could have">
|
|
60
|
-
"""
|
|
1
|
+
Feature: Background output
|
|
2
|
+
|
|
3
|
+
A background model's string output is a Gherkin representation of itself and its most relevant attribute for
|
|
4
|
+
inspection is the name of the background that it models.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Background:
|
|
8
|
+
Given the following gherkin:
|
|
9
|
+
"""
|
|
10
|
+
Background: A background with everything that it could have
|
|
11
|
+
|
|
12
|
+
Including a description
|
|
13
|
+
and then some.
|
|
14
|
+
|
|
15
|
+
* a step
|
|
16
|
+
|value|
|
|
17
|
+
* another step
|
|
18
|
+
\"\"\"
|
|
19
|
+
some string
|
|
20
|
+
\"\"\"
|
|
21
|
+
"""
|
|
22
|
+
And a background model based on that gherkin
|
|
23
|
+
"""
|
|
24
|
+
@model = CukeModeler::Background.new(<source_text>)
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
Scenario: Stringify a background model
|
|
29
|
+
When the model is output as a string
|
|
30
|
+
"""
|
|
31
|
+
@model.to_s
|
|
32
|
+
"""
|
|
33
|
+
Then the following text is provided:
|
|
34
|
+
"""
|
|
35
|
+
Background: A background with everything that it could have
|
|
36
|
+
|
|
37
|
+
Including a description
|
|
38
|
+
and then some.
|
|
39
|
+
|
|
40
|
+
* a step
|
|
41
|
+
| value |
|
|
42
|
+
* another step
|
|
43
|
+
\"\"\"
|
|
44
|
+
some string
|
|
45
|
+
\"\"\"
|
|
46
|
+
"""
|
|
47
|
+
And the output can be used to make an equivalent model
|
|
48
|
+
"""
|
|
49
|
+
CukeModeler::Background.new(@model.to_s)
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
Scenario: Inspect a background model
|
|
53
|
+
When the model is inspected
|
|
54
|
+
"""
|
|
55
|
+
@model.inspect
|
|
56
|
+
"""
|
|
57
|
+
Then the following text is provided:
|
|
58
|
+
"""
|
|
59
|
+
#<CukeModeler::Background:<object_id> @name: "A background with everything that it could have">
|
|
60
|
+
"""
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
Feature: Cell modeling
|
|
2
|
-
|
|
3
|
-
Cell models represent an individual cell in a table row (either a step table or an example table). They expose several attributes of the cell that they represent.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Background:
|
|
7
|
-
Given the following gherkin:
|
|
8
|
-
"""
|
|
9
|
-
foo
|
|
10
|
-
"""
|
|
11
|
-
And a cell model based on that gherkin
|
|
12
|
-
"""
|
|
13
|
-
@model = CukeModeler::Cell.new(<source_text>)
|
|
14
|
-
"""
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Scenario: Modeling a cell's value
|
|
18
|
-
When the cell's value is requested
|
|
19
|
-
"""
|
|
20
|
-
@model.value
|
|
21
|
-
"""
|
|
22
|
-
Then the model returns "foo"
|
|
23
|
-
|
|
24
|
-
Scenario: Modeling a cell's source line
|
|
25
|
-
Given the following gherkin:
|
|
26
|
-
"""
|
|
27
|
-
Feature:
|
|
28
|
-
|
|
29
|
-
Scenario:
|
|
30
|
-
* a step
|
|
31
|
-
| foo |
|
|
32
|
-
"""
|
|
33
|
-
And a feature model based on that gherkin
|
|
34
|
-
"""
|
|
35
|
-
@model = CukeModeler::Feature.new(<source_text>)
|
|
36
|
-
"""
|
|
37
|
-
And the cell model inside of that feature model
|
|
38
|
-
"""
|
|
39
|
-
@model = @model.tests.first.steps.first.block.rows.first.cells.first
|
|
40
|
-
"""
|
|
41
|
-
When the cell's source line is requested
|
|
42
|
-
"""
|
|
43
|
-
@model.source_line
|
|
44
|
-
"""
|
|
45
|
-
Then the model returns "5"
|
|
46
|
-
|
|
47
|
-
Scenario: Modeling a cell's source column
|
|
48
|
-
Given the following gherkin:
|
|
49
|
-
"""
|
|
50
|
-
Feature:
|
|
51
|
-
|
|
52
|
-
Scenario:
|
|
53
|
-
* a step
|
|
54
|
-
| foo |
|
|
55
|
-
"""
|
|
56
|
-
And a feature model based on that gherkin
|
|
57
|
-
"""
|
|
58
|
-
@model = CukeModeler::Feature.new(<source_text>)
|
|
59
|
-
"""
|
|
60
|
-
And the cell model inside of that feature model
|
|
61
|
-
"""
|
|
62
|
-
@model = @model.tests.first.steps.first.block.rows.first.cells.first
|
|
63
|
-
"""
|
|
64
|
-
When the cell's source column is requested
|
|
65
|
-
"""
|
|
66
|
-
@model.source_column
|
|
67
|
-
"""
|
|
68
|
-
Then the model returns "9"
|
|
1
|
+
Feature: Cell modeling
|
|
2
|
+
|
|
3
|
+
Cell models represent an individual cell in a table row (either a step table or an example table). They expose several attributes of the cell that they represent.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Background:
|
|
7
|
+
Given the following gherkin:
|
|
8
|
+
"""
|
|
9
|
+
foo
|
|
10
|
+
"""
|
|
11
|
+
And a cell model based on that gherkin
|
|
12
|
+
"""
|
|
13
|
+
@model = CukeModeler::Cell.new(<source_text>)
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Scenario: Modeling a cell's value
|
|
18
|
+
When the cell's value is requested
|
|
19
|
+
"""
|
|
20
|
+
@model.value
|
|
21
|
+
"""
|
|
22
|
+
Then the model returns "foo"
|
|
23
|
+
|
|
24
|
+
Scenario: Modeling a cell's source line
|
|
25
|
+
Given the following gherkin:
|
|
26
|
+
"""
|
|
27
|
+
Feature:
|
|
28
|
+
|
|
29
|
+
Scenario:
|
|
30
|
+
* a step
|
|
31
|
+
| foo |
|
|
32
|
+
"""
|
|
33
|
+
And a feature model based on that gherkin
|
|
34
|
+
"""
|
|
35
|
+
@model = CukeModeler::Feature.new(<source_text>)
|
|
36
|
+
"""
|
|
37
|
+
And the cell model inside of that feature model
|
|
38
|
+
"""
|
|
39
|
+
@model = @model.tests.first.steps.first.block.rows.first.cells.first
|
|
40
|
+
"""
|
|
41
|
+
When the cell's source line is requested
|
|
42
|
+
"""
|
|
43
|
+
@model.source_line
|
|
44
|
+
"""
|
|
45
|
+
Then the model returns "5"
|
|
46
|
+
|
|
47
|
+
Scenario: Modeling a cell's source column
|
|
48
|
+
Given the following gherkin:
|
|
49
|
+
"""
|
|
50
|
+
Feature:
|
|
51
|
+
|
|
52
|
+
Scenario:
|
|
53
|
+
* a step
|
|
54
|
+
| foo |
|
|
55
|
+
"""
|
|
56
|
+
And a feature model based on that gherkin
|
|
57
|
+
"""
|
|
58
|
+
@model = CukeModeler::Feature.new(<source_text>)
|
|
59
|
+
"""
|
|
60
|
+
And the cell model inside of that feature model
|
|
61
|
+
"""
|
|
62
|
+
@model = @model.tests.first.steps.first.block.rows.first.cells.first
|
|
63
|
+
"""
|
|
64
|
+
When the cell's source column is requested
|
|
65
|
+
"""
|
|
66
|
+
@model.source_column
|
|
67
|
+
"""
|
|
68
|
+
Then the model returns "9"
|