cuke_modeler 0.4.1 → 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 +4 -4
- data/.gitignore +17 -17
- data/.travis.yml +1 -1
- data/Gemfile +4 -0
- data/History.rdoc +71 -3
- data/LICENSE.txt +22 -22
- data/README.md +24 -10
- data/Rakefile +2 -12
- data/cuke_modeler.gemspec +1 -1
- data/features/analysis/test_comparison.feature +37 -122
- data/features/modeling/background_modeling.feature +77 -0
- data/features/modeling/background_output.feature +42 -0
- data/features/modeling/cell_modeling.feature +23 -0
- data/features/modeling/cell_output.feature +22 -0
- data/features/modeling/directory_modeling.feature +65 -0
- data/features/modeling/directory_output.feature +12 -0
- data/features/modeling/doc_string_modeling.feature +61 -0
- data/features/modeling/doc_string_output.feature +32 -0
- data/features/modeling/example_modeling.feature +125 -0
- data/features/modeling/example_output.feature +39 -0
- data/features/modeling/feature_file_modeling.feature +40 -0
- data/features/modeling/feature_file_output.feature +12 -0
- data/features/modeling/feature_modeling.feature +109 -0
- data/features/modeling/feature_output.feature +104 -0
- data/features/modeling/model_output.feature +22 -0
- data/features/modeling/model_structure.feature +48 -0
- data/features/modeling/outline_modeling.feature +144 -0
- data/features/modeling/outline_output.feature +69 -0
- data/features/modeling/row_modeling.feature +48 -0
- data/features/modeling/row_output.feature +22 -0
- data/features/modeling/scenario_modeling.feature +118 -0
- data/features/modeling/scenario_output.feature +45 -0
- data/features/modeling/step_modeling.feature +84 -0
- data/features/modeling/step_output.feature +29 -0
- data/features/modeling/table_modeling.feature +50 -0
- data/features/modeling/table_output.feature +24 -0
- data/features/modeling/tag_modeling.feature +43 -0
- data/features/modeling/tag_output.feature +22 -0
- data/features/step_definitions/action_steps.rb +11 -1
- data/features/step_definitions/background_steps.rb +1 -85
- data/features/step_definitions/directory_steps.rb +2 -48
- data/features/step_definitions/doc_string_steps.rb +1 -67
- data/features/step_definitions/feature_file_steps.rb +2 -37
- data/features/step_definitions/feature_steps.rb +4 -100
- data/features/step_definitions/modeling_steps.rb +44 -0
- data/features/step_definitions/setup_steps.rb +19 -41
- data/features/step_definitions/step_steps.rb +2 -166
- data/features/step_definitions/table_steps.rb +1 -58
- data/features/step_definitions/tag_steps.rb +2 -72
- data/features/step_definitions/verification_steps.rb +152 -4
- data/features/support/env.rb +4 -6
- data/gemfiles/{gherkin.gemfile → gherkin2.gemfile} +4 -0
- data/gemfiles/gherkin3.gemfile +4 -0
- data/gemfiles/gherkin4.gemfile +4 -0
- data/lib/cuke_modeler.rb +24 -22
- data/lib/cuke_modeler/adapters/gherkin_2_adapter.rb +103 -31
- data/lib/cuke_modeler/adapters/gherkin_3_adapter.rb +103 -40
- data/lib/cuke_modeler/adapters/gherkin_4_adapter.rb +111 -50
- data/lib/cuke_modeler/containing.rb +255 -4
- data/lib/cuke_modeler/described.rb +28 -0
- data/lib/cuke_modeler/models/background.rb +66 -0
- data/lib/cuke_modeler/models/cell.rb +48 -0
- data/lib/cuke_modeler/models/directory.rb +95 -0
- data/lib/cuke_modeler/models/doc_string.rb +59 -0
- data/lib/cuke_modeler/models/example.rb +167 -0
- data/lib/cuke_modeler/models/feature.rb +106 -0
- data/lib/cuke_modeler/models/feature_file.rb +64 -0
- data/lib/cuke_modeler/models/model.rb +32 -0
- data/lib/cuke_modeler/models/outline.rb +79 -0
- data/lib/cuke_modeler/models/row.rb +49 -0
- data/lib/cuke_modeler/models/scenario.rb +69 -0
- data/lib/cuke_modeler/models/step.rb +68 -0
- data/lib/cuke_modeler/models/table.rb +67 -0
- data/lib/cuke_modeler/models/tag.rb +46 -0
- data/lib/cuke_modeler/named.rb +19 -0
- data/lib/cuke_modeler/nested.rb +22 -15
- data/lib/cuke_modeler/parsed.rb +11 -0
- data/lib/cuke_modeler/parsing.rb +66 -83
- data/lib/cuke_modeler/sourceable.rb +3 -11
- data/lib/cuke_modeler/stepped.rb +24 -0
- data/lib/cuke_modeler/taggable.rb +6 -29
- data/lib/cuke_modeler/version.rb +2 -1
- data/spec/integration/background_integration_spec.rb +332 -7
- data/spec/integration/cell_integration_spec.rb +321 -0
- data/spec/integration/directory_integration_spec.rb +175 -9
- data/spec/integration/doc_string_integration_spec.rb +318 -7
- data/spec/integration/example_integration_spec.rb +602 -19
- data/spec/integration/feature_file_integration_spec.rb +98 -3
- data/spec/integration/feature_integration_spec.rb +445 -27
- data/spec/integration/gherkin_2_adapter_spec.rb +122 -0
- data/spec/integration/gherkin_3_adapter_spec.rb +125 -0
- data/spec/integration/gherkin_4_adapter_spec.rb +123 -0
- data/spec/integration/model_integration_spec.rb +15 -0
- data/spec/integration/nested_integration_spec.rb +91 -0
- data/spec/integration/outline_integration_spec.rb +485 -12
- data/spec/integration/parsing_integration_spec.rb +85 -0
- data/spec/integration/row_integration_spec.rb +221 -18
- data/spec/integration/scenario_integration_spec.rb +368 -14
- data/spec/integration/shared/models_integration_specs.rb +18 -0
- data/spec/integration/step_integration_spec.rb +328 -77
- data/spec/integration/table_integration_spec.rb +242 -20
- data/spec/integration/tag_integration_spec.rb +178 -13
- data/spec/spec_helper.rb +32 -18
- data/spec/unit/background_unit_spec.rb +24 -44
- data/spec/unit/cell_unit_spec.rb +73 -0
- data/spec/unit/described_unit_spec.rb +23 -0
- data/spec/unit/directory_unit_spec.rb +52 -62
- data/spec/unit/doc_string_unit_spec.rb +47 -100
- data/spec/unit/example_unit_spec.rb +50 -296
- data/spec/unit/feature_file_unit_spec.rb +53 -52
- data/spec/unit/feature_unit_spec.rb +39 -83
- data/spec/unit/model_unit_spec.rb +15 -0
- data/spec/unit/named_unit_spec.rb +23 -0
- data/spec/unit/nested_unit_spec.rb +24 -21
- data/spec/unit/outline_unit_spec.rb +46 -69
- data/spec/unit/parsed_unit_spec.rb +27 -0
- data/spec/unit/parsing_unit_spec.rb +2 -70
- data/spec/unit/row_unit_spec.rb +22 -51
- data/spec/unit/scenario_unit_spec.rb +27 -59
- data/spec/unit/{bare_bones_unit_specs.rb → shared/bare_bones_models_unit_specs.rb} +2 -2
- data/spec/unit/shared/containing_models_unit_specs.rb +18 -0
- data/spec/unit/shared/described_models_unit_specs.rb +38 -0
- data/spec/unit/shared/models_unit_specs.rb +15 -0
- data/spec/unit/shared/named_models_unit_specs.rb +39 -0
- data/spec/unit/shared/nested_models_unit_specs.rb +51 -0
- data/spec/unit/shared/parsed_models_unit_specs.rb +39 -0
- data/spec/unit/shared/prepopulated_models_unit_specs.rb +18 -0
- data/spec/unit/shared/sourced_models_unit_specs.rb +39 -0
- data/spec/unit/shared/stepped_models_unit_specs.rb +46 -0
- data/spec/unit/shared/stringifiable_models_unit_specs.rb +18 -0
- data/spec/unit/shared/tagged_models_unit_specs.rb +72 -0
- data/spec/unit/sourceable_unit_spec.rb +12 -4
- data/spec/unit/step_unit_spec.rb +40 -231
- data/spec/unit/stepped_unit_spec.rb +23 -0
- data/spec/unit/table_unit_spec.rb +27 -89
- data/spec/unit/tag_unit_spec.rb +30 -53
- data/spec/unit/taggable_unit_spec.rb +26 -42
- data/todo.txt +32 -0
- metadata +135 -217
- data/features/analysis/test_manipulation.feature +0 -37
- data/features/modeling/gherkin/background_modeling.feature +0 -65
- data/features/modeling/gherkin/background_output.feature +0 -131
- data/features/modeling/gherkin/directory_modeling.feature +0 -110
- data/features/modeling/gherkin/directory_output.feature +0 -14
- data/features/modeling/gherkin/doc_string_modeling.feature +0 -53
- data/features/modeling/gherkin/doc_string_output.feature +0 -72
- data/features/modeling/gherkin/example_modeling.feature +0 -101
- data/features/modeling/gherkin/example_output.feature +0 -193
- data/features/modeling/gherkin/feature_file_modeling.feature +0 -54
- data/features/modeling/gherkin/feature_file_output.feature +0 -14
- data/features/modeling/gherkin/feature_modeling.feature +0 -154
- data/features/modeling/gherkin/feature_output.feature +0 -245
- data/features/modeling/gherkin/outline_modeling.feature +0 -90
- data/features/modeling/gherkin/outline_output.feature +0 -198
- data/features/modeling/gherkin/row_modeling.feature +0 -68
- data/features/modeling/gherkin/row_output.feature +0 -28
- data/features/modeling/gherkin/scenario_modeling.feature +0 -79
- data/features/modeling/gherkin/scenario_output.feature +0 -148
- data/features/modeling/gherkin/step_modeling.feature +0 -75
- data/features/modeling/gherkin/step_output.feature +0 -53
- data/features/modeling/gherkin/table_modeling.feature +0 -42
- data/features/modeling/gherkin/table_output.feature +0 -43
- data/features/modeling/gherkin/table_row_modeling.feature +0 -57
- data/features/modeling/gherkin/table_row_output.feature +0 -28
- data/features/modeling/gherkin/tag_modeling.feature +0 -48
- data/features/modeling/gherkin/tag_output.feature +0 -17
- data/features/modeling/gherkin3/background_modeling.feature +0 -64
- data/features/modeling/gherkin3/background_output.feature +0 -131
- data/features/modeling/gherkin3/directory_modeling.feature +0 -110
- data/features/modeling/gherkin3/directory_output.feature +0 -14
- data/features/modeling/gherkin3/doc_string_modeling.feature +0 -53
- data/features/modeling/gherkin3/doc_string_output.feature +0 -72
- data/features/modeling/gherkin3/example_modeling.feature +0 -100
- data/features/modeling/gherkin3/example_output.feature +0 -207
- data/features/modeling/gherkin3/feature_file_modeling.feature +0 -54
- data/features/modeling/gherkin3/feature_file_output.feature +0 -14
- data/features/modeling/gherkin3/feature_modeling.feature +0 -155
- data/features/modeling/gherkin3/feature_output.feature +0 -249
- data/features/modeling/gherkin3/outline_modeling.feature +0 -89
- data/features/modeling/gherkin3/outline_output.feature +0 -255
- data/features/modeling/gherkin3/row_modeling.feature +0 -68
- data/features/modeling/gherkin3/row_output.feature +0 -28
- data/features/modeling/gherkin3/scenario_modeling.feature +0 -78
- data/features/modeling/gherkin3/scenario_output.feature +0 -148
- data/features/modeling/gherkin3/step_modeling.feature +0 -75
- data/features/modeling/gherkin3/step_output.feature +0 -53
- data/features/modeling/gherkin3/table_modeling.feature +0 -42
- data/features/modeling/gherkin3/table_output.feature +0 -43
- data/features/modeling/gherkin3/table_row_modeling.feature +0 -57
- data/features/modeling/gherkin3/table_row_output.feature +0 -28
- data/features/modeling/gherkin3/tag_modeling.feature +0 -49
- data/features/modeling/gherkin3/tag_output.feature +0 -17
- data/features/modeling/gherkin4/background_modeling.feature +0 -64
- data/features/modeling/gherkin4/background_output.feature +0 -131
- data/features/modeling/gherkin4/directory_modeling.feature +0 -110
- data/features/modeling/gherkin4/directory_output.feature +0 -14
- data/features/modeling/gherkin4/doc_string_modeling.feature +0 -53
- data/features/modeling/gherkin4/doc_string_output.feature +0 -72
- data/features/modeling/gherkin4/example_modeling.feature +0 -100
- data/features/modeling/gherkin4/example_output.feature +0 -193
- data/features/modeling/gherkin4/feature_file_modeling.feature +0 -54
- data/features/modeling/gherkin4/feature_file_output.feature +0 -14
- data/features/modeling/gherkin4/feature_modeling.feature +0 -153
- data/features/modeling/gherkin4/feature_output.feature +0 -245
- data/features/modeling/gherkin4/outline_modeling.feature +0 -89
- data/features/modeling/gherkin4/outline_output.feature +0 -198
- data/features/modeling/gherkin4/row_modeling.feature +0 -68
- data/features/modeling/gherkin4/row_output.feature +0 -28
- data/features/modeling/gherkin4/scenario_modeling.feature +0 -78
- data/features/modeling/gherkin4/scenario_output.feature +0 -148
- data/features/modeling/gherkin4/step_modeling.feature +0 -75
- data/features/modeling/gherkin4/step_output.feature +0 -53
- data/features/modeling/gherkin4/table_modeling.feature +0 -42
- data/features/modeling/gherkin4/table_output.feature +0 -43
- data/features/modeling/gherkin4/table_row_modeling.feature +0 -57
- data/features/modeling/gherkin4/table_row_output.feature +0 -28
- data/features/modeling/gherkin4/tag_modeling.feature +0 -48
- data/features/modeling/gherkin4/tag_output.feature +0 -17
- data/features/step_definitions/outline_steps.rb +0 -258
- data/features/step_definitions/test_steps.rb +0 -123
- data/lib/cuke_modeler/background.rb +0 -38
- data/lib/cuke_modeler/directory.rb +0 -83
- data/lib/cuke_modeler/doc_string.rb +0 -87
- data/lib/cuke_modeler/example.rb +0 -195
- data/lib/cuke_modeler/feature.rb +0 -147
- data/lib/cuke_modeler/feature_element.rb +0 -73
- data/lib/cuke_modeler/feature_file.rb +0 -77
- data/lib/cuke_modeler/outline.rb +0 -68
- data/lib/cuke_modeler/raw.rb +0 -20
- data/lib/cuke_modeler/row.rb +0 -64
- data/lib/cuke_modeler/scenario.rb +0 -45
- data/lib/cuke_modeler/step.rb +0 -216
- data/lib/cuke_modeler/table.rb +0 -90
- data/lib/cuke_modeler/table_row.rb +0 -64
- data/lib/cuke_modeler/tag.rb +0 -62
- data/lib/cuke_modeler/test_element.rb +0 -79
- data/lib/cuke_modeler/world.rb +0 -113
- data/spec/integration/table_row_integration_spec.rb +0 -76
- data/spec/integration/world_integration_spec.rb +0 -14
- data/spec/unit/containing_element_unit_specs.rb +0 -18
- data/spec/unit/feature_element_unit_spec.rb +0 -19
- data/spec/unit/feature_element_unit_specs.rb +0 -52
- data/spec/unit/nested_element_unit_specs.rb +0 -39
- data/spec/unit/prepopulated_unit_specs.rb +0 -14
- data/spec/unit/raw_element_unit_specs.rb +0 -27
- data/spec/unit/raw_unit_spec.rb +0 -28
- data/spec/unit/sourced_element_unit_specs.rb +0 -18
- data/spec/unit/table_row_unit_spec.rb +0 -102
- data/spec/unit/tagged_element_unit_specs.rb +0 -67
- data/spec/unit/test_element_unit_spec.rb +0 -54
- data/spec/unit/test_element_unit_specs.rb +0 -34
- data/spec/unit/world_unit_spec.rb +0 -140
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d45c74a6f723c171dac766c39700fe913bb5780
|
|
4
|
+
data.tar.gz: e75f758bd4197d5ba5894c1c147d8a9e8a393d0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d1be16e1d99e64f661d87b22fa5efce4feb84444b7c498628ee964ef491a621c1c041b1437c1e6c265abf784bfb6ac80ee2048433402c40889be9555761c4cd4
|
|
7
|
+
data.tar.gz: f9866720e77b5d436b5e88dbeb791bc7b92384bd39ceb3c55cd201570c2868b09de93eec85f260940da0f98de32ce162b0bcb1899b9db9545b133d5041f5066e
|
data/.gitignore
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
*.gem
|
|
2
|
-
*.rbc
|
|
3
|
-
.bundle
|
|
4
|
-
.config
|
|
5
|
-
.yardoc
|
|
6
|
-
Gemfile.lock
|
|
7
|
-
InstalledFiles
|
|
8
|
-
_yardoc
|
|
9
|
-
coverage
|
|
10
|
-
doc/
|
|
11
|
-
lib/bundler/man
|
|
12
|
-
pkg
|
|
13
|
-
rdoc
|
|
14
|
-
spec/reports
|
|
15
|
-
test/tmp
|
|
16
|
-
test/version_tmp
|
|
17
|
-
tmp
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
.bundle
|
|
4
|
+
.config
|
|
5
|
+
.yardoc
|
|
6
|
+
Gemfile.lock
|
|
7
|
+
InstalledFiles
|
|
8
|
+
_yardoc
|
|
9
|
+
coverage
|
|
10
|
+
doc/
|
|
11
|
+
lib/bundler/man
|
|
12
|
+
pkg
|
|
13
|
+
rdoc
|
|
14
|
+
spec/reports
|
|
15
|
+
test/tmp
|
|
16
|
+
test/version_tmp
|
|
17
|
+
tmp
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/History.rdoc
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
|
+
=== Version 1.0.0 / 2016-09-08
|
|
2
|
+
|
|
3
|
+
* All modeled elements of a Cucumber test suite are now modeled with actual classes. Previously, some elements (such as
|
|
4
|
+
tags or rows in an example table) were modeled with simple strings.
|
|
5
|
+
|
|
6
|
+
* A base model class has been added in order to simplify adding new element models. Other classes and modules used for
|
|
7
|
+
organizing common model behavior have been created/removed/renamed.
|
|
8
|
+
|
|
9
|
+
* Feature file models now only have a single feature model instead of a collection of them (that would only ever have
|
|
10
|
+
one item in it).
|
|
11
|
+
|
|
12
|
+
* Rows in an example table and rows in a step table no longer use two different classes for modeling.
|
|
13
|
+
|
|
14
|
+
* Background models can now be compared to other models that have steps (i.e. scenarios and outlines).
|
|
15
|
+
|
|
16
|
+
* All models for Gherkin elements now track the line number from which they originate in a source file.
|
|
17
|
+
|
|
18
|
+
* The source line of a model is now a mutable attribute instead of being read only.
|
|
19
|
+
|
|
20
|
+
* The file path of a feature file is now a mutable attribute instead of being read only.
|
|
21
|
+
|
|
22
|
+
* Standardized the initial values of the attributes of abstractly created models so that they are consistent across
|
|
23
|
+
model types.
|
|
24
|
+
|
|
25
|
+
* Added specific ancestor types for scenario, outline, and background models as alternatives to the generic 'test'
|
|
26
|
+
ancestor type.
|
|
27
|
+
|
|
28
|
+
* Extra whitespace around parsed element descriptions is now trimmed away before being stored in a model.
|
|
29
|
+
|
|
30
|
+
* Adding rows to examples via hashes can now be done without regard to the order of the keys in the hash. The correct
|
|
31
|
+
order can be determined by the model.
|
|
32
|
+
|
|
33
|
+
* The saved parsing data that is generated by the 'gherkin' gem is no longer duplicated for each model, resulting in
|
|
34
|
+
significantly less memory usage.
|
|
35
|
+
|
|
36
|
+
* String output of models has been improved. More special characters in Gherkin (e.g. vertical bars in rows) are
|
|
37
|
+
appropriately escaped in the string output of a model and several minor bugs related to using model string output as
|
|
38
|
+
the input text for new models have been fixed.
|
|
39
|
+
|
|
40
|
+
* Removed the backdoor used to pass around model data during the model creation process. Model input can now only be
|
|
41
|
+
text.
|
|
42
|
+
|
|
43
|
+
* Simple counting methods have been removed. Ruby's collection methods are just as easy to use directly when dealing
|
|
44
|
+
with classes that contain collections and the removal of these counting methods simplifies the codebase.
|
|
45
|
+
|
|
46
|
+
* The 'World' module has been removed. The scope of this gem is to model files written in Gherkin. Concepts like
|
|
47
|
+
'step definitions' and 'hooks' are better left to libraries that include (possibly programming language specific)
|
|
48
|
+
test execution logic within their scope of concern.
|
|
49
|
+
|
|
50
|
+
* Step models no longer have 'arguments' because they require the concept of step definitions, which are no longer
|
|
51
|
+
within the scope of this gem.
|
|
52
|
+
|
|
53
|
+
* Removed deprecated behavior
|
|
54
|
+
- Marked
|
|
55
|
+
- Doc strings no longer use an array of strings to model their content
|
|
56
|
+
- Tables no longer use nested arrays of strings to model their rows
|
|
57
|
+
- Models that have descriptions no longer use an array of strings to model their description
|
|
58
|
+
- The convenient (read: awkward) #step_text has been removed.
|
|
59
|
+
- Unmarked
|
|
60
|
+
- Examples no longer use an array of hashes to model their rows
|
|
61
|
+
|
|
62
|
+
* Various methods have been renamed.
|
|
63
|
+
|
|
64
|
+
|
|
1
65
|
=== Version 0.4.1 / 2016-05-12
|
|
2
66
|
|
|
3
|
-
* Increased the flexibility of input when adding rows to an Example object.
|
|
67
|
+
* Increased the flexibility of input when adding rows to an Example object. Non-string values can now be used as input
|
|
68
|
+
and they will be converted into strings. Original input objects are not modified.
|
|
4
69
|
* Added some error checking around adding value rows to an Example object without adding a parameter row as well.
|
|
5
70
|
|
|
6
71
|
|
|
@@ -8,7 +73,7 @@
|
|
|
8
73
|
|
|
9
74
|
* The path of a Directory object is now a changeable attribute instead of only being populated if the instance was
|
|
10
75
|
given a diretory to model.
|
|
11
|
-
* Bug fix - Fixed a bug that occurred if a Directory object was asked for its #name when it was created '
|
|
76
|
+
* Bug fix - Fixed a bug that occurred if a Directory object was asked for its #name when it was created as 'abstract'
|
|
12
77
|
instead of modeling an existing directory.
|
|
13
78
|
|
|
14
79
|
|
|
@@ -21,12 +86,15 @@
|
|
|
21
86
|
|
|
22
87
|
=== Version 0.2.0 / 2016-02-21
|
|
23
88
|
|
|
24
|
-
* Better error feedback when parsing errors are encountered.
|
|
89
|
+
* Better error feedback when parsing errors are encountered. It is now easier to tell which file contained invalid
|
|
90
|
+
Gherkin.
|
|
25
91
|
|
|
26
92
|
|
|
27
93
|
=== Version 0.1.0 / 2016-02-10
|
|
28
94
|
|
|
29
95
|
* Support for version 3.x of the 'gherkin' gem added.
|
|
96
|
+
* Bug fix - The saved parsing data that is generated by the 'gherkin' gem is no longer modified by the rest of the
|
|
97
|
+
model creation process.
|
|
30
98
|
|
|
31
99
|
|
|
32
100
|
=== Version 0.0.2 / 2015-11-22
|
data/LICENSE.txt
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
Copyright (c) 2014 Eric Kessler
|
|
2
|
-
|
|
3
|
-
MIT License
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
a copy of this software and associated documentation files (the
|
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
-
the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
|
14
|
-
included in all copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
Copyright (c) 2014 Eric Kessler
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
# CukeModeler
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
There comes a time in every programmer's adventures with Cucumber when they want to do Really Cool
|
|
4
|
+
Stuff with their tests. This usually necessitates scanning all of their feature files and playing
|
|
5
|
+
with the output. While the **[gherkin](https://github.com/cucumber/gherkin)** gem does a fine job of parsing feature files, reading or even
|
|
6
|
+
manipulating the resulting Abstract Syntax Tree is not always fun. **cuke_modeler** comes to the
|
|
7
|
+
rescue by providing a modeling layer that is easier to work with.
|
|
8
|
+
|
|
9
|
+
Whether you just want something that will let you easily inspect your test suite or you are looking
|
|
10
|
+
for a foundation tool upon which to build something Really Neat, this gem has you covered.
|
|
11
|
+
|
|
7
12
|
|
|
8
13
|
## Installation
|
|
9
14
|
|
|
@@ -23,7 +28,7 @@ Or install it yourself as:
|
|
|
23
28
|
|
|
24
29
|
First, load up the gem code.
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
require 'cuke_modeler'
|
|
27
32
|
|
|
28
33
|
Next, choose what you want to model. Directories and feature files are the most
|
|
29
34
|
common thing to model but smaller portions of a test suite can be modeled as well.
|
|
@@ -46,7 +51,7 @@ and setting their attributes afterward.
|
|
|
46
51
|
|
|
47
52
|
step = CukeModeler::Step.new
|
|
48
53
|
step.keyword = 'Given'
|
|
49
|
-
step.
|
|
54
|
+
step.text = 'some step'
|
|
50
55
|
|
|
51
56
|
test = CukeModeler::Scenario.new
|
|
52
57
|
test.steps = [step]
|
|
@@ -54,7 +59,15 @@ and setting their attributes afterward.
|
|
|
54
59
|
test.to_s #=> "Scenario:\n Given some step"
|
|
55
60
|
|
|
56
61
|
One could, if so inclined, use this method to dynamically edit or even create an
|
|
57
|
-
entire test suite
|
|
62
|
+
entire test suite!
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## Modeling other versions of Cucumber
|
|
66
|
+
|
|
67
|
+
Although this gem is written in Ruby and requires it to run, the modeling capabilities provided are for
|
|
68
|
+
the feature file layer of a Cucumber test suite. As such, any feature file that is written in Gherkin can
|
|
69
|
+
be modeled, even if that feature is ultimately run with SpecFlow (Cucumber for C#), Lettuce (Cucumber for
|
|
70
|
+
Python), or some other flavor of Cucumber.
|
|
58
71
|
|
|
59
72
|
|
|
60
73
|
### Other gems that are (or soon will be) powered by cuke_modeler
|
|
@@ -64,10 +77,11 @@ entire test suite.
|
|
|
64
77
|
* https://github.com/enkessler/cuke_cataloger
|
|
65
78
|
* https://github.com/grange-insurance/cuke_slicer
|
|
66
79
|
|
|
80
|
+
|
|
67
81
|
## Contributing
|
|
68
82
|
|
|
69
83
|
1. Fork it
|
|
70
|
-
2. Create your feature branch (`git checkout -b my-new-feature`
|
|
71
|
-
3. Commit your changes
|
|
72
|
-
4. Push to the branch
|
|
84
|
+
2. Create your feature branch (off of the development branch): `git checkout -b my-new-feature`
|
|
85
|
+
3. Commit your changes: `git commit -am 'Add some feature'`
|
|
86
|
+
4. Push to the branch: `git push origin my-new-feature`
|
|
73
87
|
5. Create new Pull Request
|
data/Rakefile
CHANGED
|
@@ -25,18 +25,8 @@ namespace 'cuke_modeler' do
|
|
|
25
25
|
|
|
26
26
|
desc 'Test gem based on Ruby/dependency versions'
|
|
27
27
|
task :smart_test do |t, args|
|
|
28
|
-
rspec_args = ''
|
|
29
|
-
|
|
30
|
-
case
|
|
31
|
-
when Gem.loaded_specs['gherkin'].version.version[/^4/]
|
|
32
|
-
cucumber_args = '-t ~@gherkin -t ~@gherkin3'
|
|
33
|
-
when Gem.loaded_specs['gherkin'].version.version[/^3/]
|
|
34
|
-
cucumber_args = '-t ~@gherkin -t ~@gherkin4'
|
|
35
|
-
else
|
|
36
|
-
cucumber_args = '-t ~@gherkin3 -t ~@gherkin4'
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
cucumber_args += ' -f progress'
|
|
28
|
+
rspec_args = '--tag ~@wip'
|
|
29
|
+
cucumber_args = '-f progress -t ~@wip'
|
|
40
30
|
|
|
41
31
|
Rake::Task['cuke_modeler:test_everything'].invoke(rspec_args, cucumber_args)
|
|
42
32
|
end
|
data/cuke_modeler.gemspec
CHANGED
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.5"
|
|
25
25
|
spec.add_development_dependency "rake"
|
|
26
26
|
spec.add_development_dependency 'cucumber'
|
|
27
|
-
spec.add_development_dependency 'rspec', '~>
|
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
28
28
|
spec.add_development_dependency 'simplecov'
|
|
29
29
|
spec.add_development_dependency 'racatt', '~> 1.0'
|
|
30
30
|
spec.add_development_dependency 'coveralls'
|
|
@@ -1,123 +1,38 @@
|
|
|
1
|
-
Feature: Test
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Scenario: Same test, different arguments and keywords
|
|
29
|
-
Given this *similarly parameterized* step takes a table:
|
|
30
|
-
| data 3 |
|
|
31
|
-
| data 4 |
|
|
32
|
-
Given some setup step
|
|
33
|
-
When a step with a *parameter*
|
|
34
|
-
* a big step:
|
|
35
|
-
\"\"\"
|
|
36
|
-
A little
|
|
37
|
-
bigger doc block
|
|
38
|
-
\"\"\"
|
|
39
|
-
Then *lots* *of* *parameters*
|
|
40
|
-
|
|
41
|
-
Scenario Outline: This is the same test as an outline
|
|
42
|
-
Given this *parameterized* step takes a table:
|
|
43
|
-
| <param1> |
|
|
44
|
-
| <param2> |
|
|
45
|
-
And some setup step
|
|
46
|
-
When a step with a *parameter*
|
|
47
|
-
And a big step:
|
|
48
|
-
\"\"\"
|
|
49
|
-
little doc block
|
|
50
|
-
\"\"\"
|
|
51
|
-
Then *lots* *of* *parameters*
|
|
52
|
-
Examples:
|
|
53
|
-
| param1 | param2 |
|
|
54
|
-
| x | y |
|
|
55
|
-
Examples:
|
|
56
|
-
| param1 | param2 |
|
|
57
|
-
| a | b |
|
|
58
|
-
|
|
59
|
-
Scenario Outline: Same outline, different arguments and keywords
|
|
60
|
-
Given this *similarly parameterized* step takes a table:
|
|
61
|
-
| <param3> |
|
|
62
|
-
| <param4> |
|
|
63
|
-
Given some setup step
|
|
64
|
-
When a step with a *slightly different parameter*
|
|
65
|
-
* a big step:
|
|
66
|
-
\"\"\"
|
|
67
|
-
A little
|
|
68
|
-
bigger doc block
|
|
69
|
-
\"\"\"
|
|
70
|
-
Then *lots* *of effectively the same* *parameters*
|
|
71
|
-
Examples:
|
|
72
|
-
| param1 | param2 |
|
|
73
|
-
| h | k |
|
|
74
|
-
Examples:
|
|
75
|
-
| param1 | param2 |
|
|
76
|
-
| i | j |
|
|
77
|
-
|
|
78
|
-
Scenario: A different test
|
|
79
|
-
Given this *parameterized* step takes a table:
|
|
80
|
-
| data 1 |
|
|
81
|
-
| data 2 |
|
|
82
|
-
And not the same setup step as before
|
|
83
|
-
When a step with a *parameter*
|
|
84
|
-
And a big step:
|
|
85
|
-
\"\"\"
|
|
86
|
-
little doc block
|
|
87
|
-
\"\"\"
|
|
88
|
-
Then *lots* *of* *parameters*
|
|
89
|
-
|
|
90
|
-
Scenario Outline: This is the same different test as an outline
|
|
91
|
-
Given this *similarly parameterized* step takes a table:
|
|
92
|
-
| <param1> |
|
|
93
|
-
| <param2> |
|
|
94
|
-
And not the same setup step as before
|
|
95
|
-
When a step with a *slightly different parameter*
|
|
96
|
-
And a big step:
|
|
97
|
-
\"\"\"
|
|
98
|
-
A little
|
|
99
|
-
bigger doc block
|
|
100
|
-
\"\"\"
|
|
101
|
-
Then *lots* *of effectively the same* *parameters*
|
|
1
|
+
Feature: Test comparison
|
|
2
|
+
|
|
3
|
+
Gherkin elements that contain steps (i.e. backgrounds, scenarios, and outlines) can be compared with one another
|
|
4
|
+
in order to determine equality. Elements are considered equal if the base text of their steps match. That is, the
|
|
5
|
+
keyword used for the step and any table or doc string that may be associated with that step are ignored for the
|
|
6
|
+
purposes of comparison.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Scenario: Comparing tests
|
|
10
|
+
Given a model for the following background:
|
|
11
|
+
"""
|
|
12
|
+
Background:
|
|
13
|
+
* step 1
|
|
14
|
+
* step 2
|
|
15
|
+
"""
|
|
16
|
+
And a model for the following scenario:
|
|
17
|
+
"""
|
|
18
|
+
Scenario:
|
|
19
|
+
* step 1
|
|
20
|
+
* step 2
|
|
21
|
+
"""
|
|
22
|
+
And a model for the following outline:
|
|
23
|
+
"""
|
|
24
|
+
Scenario Outline:
|
|
25
|
+
* step 1
|
|
26
|
+
* step 2
|
|
102
27
|
Examples:
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Then test "1" is equal to test "2"
|
|
115
|
-
And test "1" is not equal to test "5"
|
|
116
|
-
|
|
117
|
-
Scenario: Outline to Outline comparison
|
|
118
|
-
Then test "3" is equal to test "4"
|
|
119
|
-
And test "3" is not equal to test "6"
|
|
120
|
-
|
|
121
|
-
Scenario: Scenario to Outline comparison
|
|
122
|
-
Then test "1" is equal to test "3"
|
|
123
|
-
And test "1" is not equal to test "6"
|
|
28
|
+
| param |
|
|
29
|
+
| value |
|
|
30
|
+
"""
|
|
31
|
+
When the models are compared
|
|
32
|
+
Then all of them are equivalent
|
|
33
|
+
But none of the models are equivalent with a model for the following scenario:
|
|
34
|
+
"""
|
|
35
|
+
Scenario:
|
|
36
|
+
* step 1
|
|
37
|
+
* step 3
|
|
38
|
+
"""
|