cuke_modeler 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.simplecov +8 -0
  4. data/Gemfile +4 -0
  5. data/History.rdoc +3 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +73 -0
  8. data/Rakefile +38 -0
  9. data/cuke_modeler.gemspec +29 -0
  10. data/features/analysis/test_comparison.feature +123 -0
  11. data/features/analysis/test_manipulation.feature +37 -0
  12. data/features/modeling/background_modeling.feature +75 -0
  13. data/features/modeling/background_output.feature +130 -0
  14. data/features/modeling/directory_modeling.feature +120 -0
  15. data/features/modeling/directory_output.feature +13 -0
  16. data/features/modeling/doc_string_modeling.feature +63 -0
  17. data/features/modeling/doc_string_output.feature +71 -0
  18. data/features/modeling/example_modeling.feature +111 -0
  19. data/features/modeling/example_output.feature +192 -0
  20. data/features/modeling/feature_file_modeling.feature +64 -0
  21. data/features/modeling/feature_file_output.feature +13 -0
  22. data/features/modeling/feature_modeling.feature +164 -0
  23. data/features/modeling/feature_output.feature +244 -0
  24. data/features/modeling/outline_modeling.feature +100 -0
  25. data/features/modeling/outline_output.feature +197 -0
  26. data/features/modeling/row_modeling.feature +77 -0
  27. data/features/modeling/row_output.feature +27 -0
  28. data/features/modeling/scenario_modeling.feature +89 -0
  29. data/features/modeling/scenario_output.feature +147 -0
  30. data/features/modeling/step_modeling.feature +85 -0
  31. data/features/modeling/step_output.feature +52 -0
  32. data/features/modeling/table_modeling.feature +52 -0
  33. data/features/modeling/table_output.feature +42 -0
  34. data/features/modeling/table_row_modeling.feature +67 -0
  35. data/features/modeling/table_row_output.feature +27 -0
  36. data/features/modeling/tag_modeling.feature +58 -0
  37. data/features/modeling/tag_output.feature +16 -0
  38. data/features/step_definitions/action_steps.rb +3 -0
  39. data/features/step_definitions/background_steps.rb +81 -0
  40. data/features/step_definitions/directory_steps.rb +52 -0
  41. data/features/step_definitions/doc_string_steps.rb +63 -0
  42. data/features/step_definitions/feature_file_steps.rb +41 -0
  43. data/features/step_definitions/feature_steps.rb +96 -0
  44. data/features/step_definitions/outline_steps.rb +252 -0
  45. data/features/step_definitions/setup_steps.rb +50 -0
  46. data/features/step_definitions/spec_steps.rb +18 -0
  47. data/features/step_definitions/step_steps.rb +159 -0
  48. data/features/step_definitions/table_steps.rb +54 -0
  49. data/features/step_definitions/tag_steps.rb +61 -0
  50. data/features/step_definitions/test_steps.rb +114 -0
  51. data/features/step_definitions/verification_steps.rb +9 -0
  52. data/features/support/env.rb +27 -0
  53. data/features/support/transforms.rb +3 -0
  54. data/lib/cuke_modeler.rb +29 -0
  55. data/lib/cuke_modeler/background.rb +38 -0
  56. data/lib/cuke_modeler/containing.rb +18 -0
  57. data/lib/cuke_modeler/directory.rb +86 -0
  58. data/lib/cuke_modeler/doc_string.rb +87 -0
  59. data/lib/cuke_modeler/example.rb +184 -0
  60. data/lib/cuke_modeler/feature.rb +147 -0
  61. data/lib/cuke_modeler/feature_element.rb +73 -0
  62. data/lib/cuke_modeler/feature_file.rb +77 -0
  63. data/lib/cuke_modeler/nested.rb +34 -0
  64. data/lib/cuke_modeler/outline.rb +68 -0
  65. data/lib/cuke_modeler/parsing.rb +32 -0
  66. data/lib/cuke_modeler/raw.rb +20 -0
  67. data/lib/cuke_modeler/row.rb +64 -0
  68. data/lib/cuke_modeler/scenario.rb +45 -0
  69. data/lib/cuke_modeler/sourceable.rb +20 -0
  70. data/lib/cuke_modeler/step.rb +214 -0
  71. data/lib/cuke_modeler/table.rb +90 -0
  72. data/lib/cuke_modeler/table_row.rb +64 -0
  73. data/lib/cuke_modeler/tag.rb +62 -0
  74. data/lib/cuke_modeler/taggable.rb +54 -0
  75. data/lib/cuke_modeler/test_element.rb +77 -0
  76. data/lib/cuke_modeler/version.rb +3 -0
  77. data/lib/cuke_modeler/world.rb +113 -0
  78. data/spec/integration/background_integration_spec.rb +72 -0
  79. data/spec/integration/directory_integration_spec.rb +48 -0
  80. data/spec/integration/doc_string_integration_spec.rb +66 -0
  81. data/spec/integration/example_integration_spec.rb +94 -0
  82. data/spec/integration/feature_file_integration_spec.rb +44 -0
  83. data/spec/integration/feature_integration_spec.rb +152 -0
  84. data/spec/integration/outline_integration_spec.rb +92 -0
  85. data/spec/integration/scenario_integration_spec.rb +80 -0
  86. data/spec/integration/step_integration_spec.rb +184 -0
  87. data/spec/integration/table_integration_spec.rb +86 -0
  88. data/spec/integration/table_row_integration_spec.rb +68 -0
  89. data/spec/integration/tag_integration_spec.rb +67 -0
  90. data/spec/integration/world_integration_spec.rb +13 -0
  91. data/spec/spec_helper.rb +30 -0
  92. data/spec/unit/background_unit_spec.rb +55 -0
  93. data/spec/unit/bare_bones_unit_specs.rb +13 -0
  94. data/spec/unit/containing_element_unit_specs.rb +17 -0
  95. data/spec/unit/directory_unit_spec.rb +103 -0
  96. data/spec/unit/doc_string_unit_spec.rb +109 -0
  97. data/spec/unit/example_unit_spec.rb +251 -0
  98. data/spec/unit/feature_element_unit_spec.rb +19 -0
  99. data/spec/unit/feature_element_unit_specs.rb +46 -0
  100. data/spec/unit/feature_file_unit_spec.rb +94 -0
  101. data/spec/unit/feature_unit_spec.rb +135 -0
  102. data/spec/unit/nested_element_unit_specs.rb +36 -0
  103. data/spec/unit/nested_unit_spec.rb +37 -0
  104. data/spec/unit/outline_unit_spec.rb +91 -0
  105. data/spec/unit/parsing_unit_spec.rb +21 -0
  106. data/spec/unit/prepopulated_unit_specs.rb +13 -0
  107. data/spec/unit/raw_element_unit_specs.rb +24 -0
  108. data/spec/unit/raw_unit_spec.rb +25 -0
  109. data/spec/unit/row_unit_spec.rb +55 -0
  110. data/spec/unit/scenario_unit_spec.rb +71 -0
  111. data/spec/unit/sourceable_unit_spec.rb +17 -0
  112. data/spec/unit/sourced_element_unit_specs.rb +18 -0
  113. data/spec/unit/step_unit_spec.rb +259 -0
  114. data/spec/unit/table_row_unit_spec.rb +55 -0
  115. data/spec/unit/table_unit_spec.rb +96 -0
  116. data/spec/unit/tag_unit_spec.rb +51 -0
  117. data/spec/unit/taggable_unit_spec.rb +78 -0
  118. data/spec/unit/tagged_element_unit_specs.rb +63 -0
  119. data/spec/unit/test_element_unit_spec.rb +40 -0
  120. data/spec/unit/test_element_unit_specs.rb +31 -0
  121. data/spec/unit/world_unit_spec.rb +130 -0
  122. metadata +364 -0
@@ -0,0 +1,100 @@
1
+ Feature: Outline elements can be modeled.
2
+
3
+
4
+ Acceptance criteria
5
+
6
+ 1. All conceptual pieces of an outline can be modeled:
7
+ - the outline's name
8
+ - the outline's description
9
+ - the outline's steps
10
+ - the outline's tags
11
+ - the outline's applied tags
12
+ - the outline's example blocks
13
+ - the outline's source line
14
+ - the outline's raw element
15
+
16
+ 2. Outlines can be outputted in a convenient form
17
+
18
+
19
+ Background: Test file setup.
20
+ Given the following feature file:
21
+ """
22
+ @a_feature_level_tag
23
+ Feature:
24
+
25
+ @outline_tag
26
+ Scenario Outline: The scenario outline's name.
27
+
28
+ Some outline description.
29
+
30
+ Some more.
31
+ Even more.
32
+
33
+ Given a <setup> step
34
+ When an action step
35
+ Then a <verification> step
36
+
37
+ Examples: example 1
38
+ | setup | verification |
39
+ | x | y |
40
+ Examples: example 2
41
+ | setup | verification |
42
+ | a | b |
43
+ """
44
+ And parameter delimiters of "*" and "*"
45
+ When the file is read
46
+
47
+
48
+ Scenario: The raw outline element is modeled.
49
+ Then the test correctly stores its underlying implementation
50
+
51
+ Scenario: The outline source line is modeled.
52
+ Then the test is found to have the following properties:
53
+ | source_line | 5 |
54
+
55
+ Scenario: The outline name is modeled.
56
+ Then the test is found to have the following properties:
57
+ | name | The scenario outline's name. |
58
+
59
+ Scenario: The outline description is modeled.
60
+ Then the test has the following description:
61
+ """
62
+
63
+ Some outline description.
64
+
65
+ Some more.
66
+ Even more.
67
+ """
68
+
69
+ Scenario: The outline steps are modeled.
70
+ Then the test steps are as follows:
71
+ | a <setup> step |
72
+ | an action step |
73
+ | a <verification> step |
74
+
75
+ Scenario: The outline tags are modeled.
76
+ Then the test is found to have the following tags:
77
+ | @outline_tag |
78
+
79
+ Scenario: The outline applied tags are modeled.
80
+ Then the test is found to have the following applied tags:
81
+ | @a_feature_level_tag |
82
+
83
+ Scenario: The outline example blocks are modeled.
84
+ And the test example blocks are as follows:
85
+ | example 1 |
86
+ | example 2 |
87
+
88
+ Scenario: Convenient output of an an outline
89
+ Then the outline has convenient output
90
+
91
+ @redundant
92
+ Scenario Outline: Outline models pass all other specifications
93
+ Exact specifications detailing the API for outline models.
94
+ Given that there are "<additional specifications>" detailing models
95
+ When the corresponding specifications are run
96
+ Then all of those specifications are met
97
+ Examples:
98
+ | additional specifications |
99
+ | outline_unit_spec.rb |
100
+ | outline_integration_spec.rb |
@@ -0,0 +1,197 @@
1
+ Feature: Outputting outline elements
2
+
3
+ The output of an element model is a representation of the element as it would
4
+ appear in gherkin.
5
+
6
+
7
+ Scenario: Output of an outline that does not have a name
8
+ Given an outline element based on the following gherkin:
9
+ """
10
+ Scenario Outline:
11
+ """
12
+ When it is outputted
13
+ Then the following text is provided:
14
+ """
15
+ Scenario Outline:
16
+ """
17
+
18
+ Scenario: Output of an outline that does have a name
19
+ Given an outline element based on the following gherkin:
20
+ """
21
+ Scenario Outline: with a name
22
+ """
23
+ When it is outputted
24
+ Then the following text is provided:
25
+ """
26
+ Scenario Outline: with a name
27
+ """
28
+
29
+ Scenario: Output of an outline that does have tags
30
+ Given an outline element based on the following gherkin:
31
+ """
32
+ @tag1@tag2
33
+ @tag3
34
+ Scenario Outline:
35
+ """
36
+ When it is outputted
37
+ Then the following text is provided:
38
+ """
39
+ @tag1 @tag2 @tag3
40
+ Scenario Outline:
41
+ """
42
+
43
+ Scenario: Output of an outline that has a description, no first line buffer
44
+ Given an outline element based on the following gherkin:
45
+ """
46
+ Scenario Outline:
47
+ Some description.
48
+ Some more description.
49
+ """
50
+ When it is outputted
51
+ Then the following text is provided:
52
+ """
53
+ Scenario Outline:
54
+
55
+ Some description.
56
+ Some more description.
57
+ """
58
+
59
+ Scenario: Output of an outline that has a description, first line is blank
60
+ Given an outline element based on the following gherkin:
61
+ """
62
+ Scenario Outline:
63
+
64
+ Some description.
65
+ Some more description.
66
+ """
67
+ When it is outputted
68
+ Then the following text is provided:
69
+ """
70
+ Scenario Outline:
71
+
72
+ Some description.
73
+ Some more description.
74
+ """
75
+
76
+ Scenario: Output of an outline that has a description, first line is only whitespace
77
+ Given an outline element based on the following gherkin:
78
+ """
79
+ Scenario Outline:
80
+
81
+ Some description.
82
+ Some more description.
83
+ """
84
+ When it is outputted
85
+ Then the following text is provided:
86
+ """
87
+ Scenario Outline:
88
+
89
+ Some description.
90
+ Some more description.
91
+ """
92
+
93
+ Scenario: Output of an outline that has steps
94
+ Given an outline element based on the following gherkin:
95
+ """
96
+ Scenario Outline:
97
+ * a step
98
+ |value|
99
+ * another step
100
+ \"\"\"
101
+ some string
102
+ \"\"\"
103
+ """
104
+ When it is outputted
105
+ Then the following text is provided:
106
+ """
107
+ Scenario Outline:
108
+ * a step
109
+ | value |
110
+ * another step
111
+ \"\"\"
112
+ some string
113
+ \"\"\"
114
+ """
115
+
116
+ Scenario: Output of an outline that has examples
117
+ Given an outline element based on the following gherkin:
118
+ """
119
+ Scenario Outline:
120
+ * a <value> step
121
+ Examples:
122
+ | value |
123
+ | x |
124
+ @example_tag
125
+ Examples:
126
+ | value |
127
+ | y |
128
+ """
129
+ When it is outputted
130
+ Then the following text is provided:
131
+ """
132
+ Scenario Outline:
133
+ * a <value> step
134
+
135
+ Examples:
136
+ | value |
137
+ | x |
138
+
139
+ @example_tag
140
+ Examples:
141
+ | value |
142
+ | y |
143
+ """
144
+
145
+ Scenario: Output of an outline that contains all possible parts
146
+ Given an outline element based on the following gherkin:
147
+ """
148
+ @tag1@tag2
149
+ @tag3
150
+ Scenario Outline: An outline with everything it could have
151
+ Some description.
152
+ Some more description.
153
+ * a step
154
+ |value|
155
+ * a <value> step
156
+ \"\"\"
157
+ some string
158
+ \"\"\"
159
+ Examples:
160
+ Some description.
161
+ Some more description.
162
+ | value |
163
+ | x |
164
+ @example_tag
165
+ Examples:
166
+ | value |
167
+ | y |
168
+ """
169
+ When it is outputted
170
+ Then the following text is provided:
171
+ """
172
+ @tag1 @tag2 @tag3
173
+ Scenario Outline: An outline with everything it could have
174
+
175
+ Some description.
176
+ Some more description.
177
+
178
+ * a step
179
+ | value |
180
+ * a <value> step
181
+ \"\"\"
182
+ some string
183
+ \"\"\"
184
+
185
+ Examples:
186
+
187
+ Some description.
188
+ Some more description.
189
+
190
+ | value |
191
+ | x |
192
+
193
+ @example_tag
194
+ Examples:
195
+ | value |
196
+ | y |
197
+ """
@@ -0,0 +1,77 @@
1
+ Feature: Row elements can be modeled.
2
+
3
+
4
+ Acceptance criteria
5
+
6
+ 1. All conceptual pieces of a Row can be modeled:
7
+ - the row's source line
8
+ - the row's cells
9
+ - the row's raw element
10
+
11
+ 2. Rows can be outputted in a convenient form
12
+
13
+
14
+ Background: Test file setup.
15
+ Given the following feature file:
16
+ """
17
+ Feature:
18
+
19
+ Scenario Outline:
20
+ * a step
21
+ Examples:
22
+ | param1 | param2 | extra param |
23
+ | x | y | ? |
24
+ | 1 | 2 | 3 |
25
+ Examples:
26
+ | param1 |
27
+ | a |
28
+ """
29
+ And parameter delimiters of "*" and "*"
30
+ When the file is read
31
+
32
+
33
+ Scenario: The raw row element is modeled.
34
+ Then the test example block row correctly stores its underlying implementation
35
+
36
+ Scenario: The row's source line is modeled.
37
+ Then the test example block "1" row "1" is found to have the following properties:
38
+ | source_line | 6 |
39
+ And the test example block "1" row "2" is found to have the following properties:
40
+ | source_line | 7 |
41
+ And the test example block "1" row "3" is found to have the following properties:
42
+ | source_line | 8 |
43
+ And the test example block "2" row "1" is found to have the following properties:
44
+ | source_line | 10 |
45
+ And the test example block "2" row "2" is found to have the following properties:
46
+ | source_line | 11 |
47
+
48
+ Scenario: The row's cells are modeled.
49
+ Then the test example block "1" row "1" cells are as follows:
50
+ | param1 |
51
+ | param2 |
52
+ | extra param |
53
+ And the test example block "1" row "2" cells are as follows:
54
+ | x |
55
+ | y |
56
+ | ? |
57
+ And the test example block "1" row "3" cells are as follows:
58
+ | 1 |
59
+ | 2 |
60
+ | 3 |
61
+ And the test example block "2" row "1" cells are as follows:
62
+ | param1 |
63
+ And the test example block "2" row "2" cells are as follows:
64
+ | a |
65
+
66
+ Scenario: Convenient output of a row
67
+ Then the row has convenient output
68
+
69
+ @redundant
70
+ Scenario Outline: Row models pass all other specifications
71
+ Exact specifications detailing the API for Row models.
72
+ Given that there are "<additional specifications>" detailing models
73
+ When the corresponding specifications are run
74
+ Then all of those specifications are met
75
+ Examples:
76
+ | additional specifications |
77
+ | row_unit_spec.rb |
@@ -0,0 +1,27 @@
1
+ Feature: Outputting row elements
2
+
3
+ The output of an element model is a representation of the element as it would
4
+ appear in gherkin.
5
+
6
+
7
+ Scenario: Output of a row that has one cell
8
+ Given a row element based on the following gherkin:
9
+ """
10
+ |value|
11
+ """
12
+ When it is outputted
13
+ Then the following text is provided:
14
+ """
15
+ | value |
16
+ """
17
+
18
+ Scenario: Output of a row that has multiple cells
19
+ Given a row element based on the following gherkin:
20
+ """
21
+ |value|another_value|
22
+ """
23
+ When it is outputted
24
+ Then the following text is provided:
25
+ """
26
+ | value | another_value |
27
+ """
@@ -0,0 +1,89 @@
1
+ Feature: Scenario elements can be modeled.
2
+
3
+
4
+ Acceptance criteria
5
+
6
+ 1. All conceptual pieces of a scenario can be modeled:
7
+ - the scenario's name
8
+ - the scenario's description
9
+ - the scenario's steps
10
+ - the scenario's tags
11
+ - the scenario's applied tags
12
+ - the scenario's source line
13
+ - the scenario's raw element
14
+
15
+ 2. Scenarios can be outputted in a convenient form
16
+
17
+
18
+ Background: Test file setup.
19
+ Given the following feature file:
20
+ """
21
+ @a_feature_level_tag
22
+ Feature:
23
+
24
+ @a_tag
25
+ @another_tag
26
+ Scenario:The first scenario's name.
27
+
28
+ Some scenario description.
29
+
30
+ Some more.
31
+ Even more.
32
+
33
+ Given a setup step
34
+ When an action step
35
+ Then a verification step
36
+ """
37
+ And parameter delimiters of "*" and "*"
38
+ When the file is read
39
+
40
+
41
+ Scenario: The raw scenario element is modeled.
42
+ Then the test correctly stores its underlying implementation
43
+
44
+ Scenario: The scenario source line is modeled.
45
+ Then the test is found to have the following properties:
46
+ | source_line | 6 |
47
+
48
+ Scenario: The scenario name is modeled.
49
+ Then the test is found to have the following properties:
50
+ | name | The first scenario's name. |
51
+
52
+ Scenario: The scenario description is modeled.
53
+ Then the test has the following description:
54
+ """
55
+
56
+ Some scenario description.
57
+
58
+ Some more.
59
+ Even more.
60
+ """
61
+
62
+ Scenario: The scenario steps are modeled.
63
+ Then the test steps are as follows:
64
+ | a setup step |
65
+ | an action step |
66
+ | a verification step |
67
+
68
+ Scenario: The scenario tags are modeled.
69
+ Then the test is found to have the following tags:
70
+ | @a_tag |
71
+ | @another_tag |
72
+
73
+ Scenario: The scenario applied tags are modeled.
74
+ Then the test is found to have the following applied tags:
75
+ | @a_feature_level_tag |
76
+
77
+ Scenario: Convenient output of a scenario
78
+ Then the scenario has convenient output
79
+
80
+ @redundant
81
+ Scenario Outline: Scenario models pass all other specifications
82
+ Exact specifications detailing the API for scenario models.
83
+ Given that there are "<additional specifications>" detailing models
84
+ When the corresponding specifications are run
85
+ Then all of those specifications are met
86
+ Examples:
87
+ | additional specifications |
88
+ | scenario_unit_spec.rb |
89
+ | scenario_integration_spec.rb |