cuke_modeler 3.19.0 → 3.20.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -1
  3. data/README.md +5 -6
  4. data/cuke_modeler.gemspec +5 -3
  5. data/lib/cuke_modeler/adapters/gherkin_10_adapter.rb +5 -5
  6. data/lib/cuke_modeler/adapters/gherkin_11_adapter.rb +5 -5
  7. data/lib/cuke_modeler/adapters/gherkin_12_adapter.rb +5 -5
  8. data/lib/cuke_modeler/adapters/gherkin_13_adapter.rb +5 -5
  9. data/lib/cuke_modeler/adapters/gherkin_14_adapter.rb +5 -5
  10. data/lib/cuke_modeler/adapters/gherkin_15_adapter.rb +5 -5
  11. data/lib/cuke_modeler/adapters/gherkin_16_adapter.rb +5 -5
  12. data/lib/cuke_modeler/adapters/gherkin_17_adapter.rb +5 -5
  13. data/lib/cuke_modeler/adapters/gherkin_18_adapter.rb +5 -2
  14. data/lib/cuke_modeler/adapters/gherkin_19_adapter.rb +5 -2
  15. data/lib/cuke_modeler/adapters/gherkin_20_adapter.rb +5 -2
  16. data/lib/cuke_modeler/adapters/gherkin_21_adapter.rb +5 -5
  17. data/lib/cuke_modeler/adapters/gherkin_22_adapter.rb +5 -5
  18. data/lib/cuke_modeler/adapters/gherkin_23_adapter.rb +5 -5
  19. data/lib/cuke_modeler/adapters/gherkin_24_adapter.rb +5 -5
  20. data/lib/cuke_modeler/adapters/gherkin_25_adapter.rb +5 -5
  21. data/lib/cuke_modeler/adapters/gherkin_26_adapter.rb +5 -5
  22. data/lib/cuke_modeler/adapters/gherkin_27_adapter.rb +13 -0
  23. data/lib/cuke_modeler/adapters/gherkin_9_adapter.rb +5 -2
  24. data/lib/cuke_modeler/adapters/gherkin_base_adapter.rb +5 -2
  25. data/lib/cuke_modeler/containing.rb +43 -210
  26. data/lib/cuke_modeler/described.rb +8 -4
  27. data/lib/cuke_modeler/models/background.rb +61 -9
  28. data/lib/cuke_modeler/models/cell.rb +44 -7
  29. data/lib/cuke_modeler/models/comment.rb +43 -7
  30. data/lib/cuke_modeler/models/directory.rb +66 -8
  31. data/lib/cuke_modeler/models/doc_string.rb +49 -7
  32. data/lib/cuke_modeler/models/example.rb +103 -17
  33. data/lib/cuke_modeler/models/feature.rb +81 -10
  34. data/lib/cuke_modeler/models/feature_file.rb +64 -10
  35. data/lib/cuke_modeler/models/model.rb +57 -6
  36. data/lib/cuke_modeler/models/outline.rb +67 -9
  37. data/lib/cuke_modeler/models/row.rb +55 -8
  38. data/lib/cuke_modeler/models/rule.rb +67 -8
  39. data/lib/cuke_modeler/models/scenario.rb +59 -9
  40. data/lib/cuke_modeler/models/step.rb +69 -10
  41. data/lib/cuke_modeler/models/table.rb +55 -8
  42. data/lib/cuke_modeler/models/tag.rb +38 -13
  43. data/lib/cuke_modeler/named.rb +7 -4
  44. data/lib/cuke_modeler/nested.rb +19 -4
  45. data/lib/cuke_modeler/parsed.rb +10 -5
  46. data/lib/cuke_modeler/parsing.rb +28 -16
  47. data/lib/cuke_modeler/sourceable.rb +11 -5
  48. data/lib/cuke_modeler/stepped.rb +7 -5
  49. data/lib/cuke_modeler/taggable.rb +22 -4
  50. data/lib/cuke_modeler/version.rb +1 -1
  51. data/testing/cucumber/features/modeling/background_output.feature +19 -5
  52. data/testing/cucumber/features/modeling/base_model.feature +3 -0
  53. data/testing/cucumber/features/modeling/cell_output.feature +18 -4
  54. data/testing/cucumber/features/modeling/comment_output.feature +19 -5
  55. data/testing/cucumber/features/modeling/directory_output.feature +21 -4
  56. data/testing/cucumber/features/modeling/doc_string_output.feature +19 -5
  57. data/testing/cucumber/features/modeling/example_output.feature +21 -7
  58. data/testing/cucumber/features/modeling/feature_file_output.feature +21 -4
  59. data/testing/cucumber/features/modeling/feature_output.feature +20 -6
  60. data/testing/cucumber/features/modeling/model_output.feature +53 -5
  61. data/testing/cucumber/features/modeling/outline_output.feature +19 -5
  62. data/testing/cucumber/features/modeling/row_output.feature +19 -5
  63. data/testing/cucumber/features/modeling/rule_output.feature +27 -6
  64. data/testing/cucumber/features/modeling/scenario_output.feature +19 -5
  65. data/testing/cucumber/features/modeling/step_output.feature +19 -5
  66. data/testing/cucumber/features/modeling/table_output.feature +18 -4
  67. data/testing/cucumber/features/modeling/tag_output.feature +19 -5
  68. metadata +8 -6
@@ -1,16 +1,33 @@
1
1
  Feature: Directory output
2
2
 
3
- A directory model's string output is simply the file path of the directory that it models. As such, output from a directory model can be used as input for the same kind of model.
3
+ A directory model's string output is simply the file path of the directory that it models and its
4
+ most relevant attribute for inspection is the path of the directory that it models.
4
5
 
5
6
 
6
- Scenario: Outputting a directory model
7
+ Background:
7
8
  Given a directory model based on "some_directory"
8
- When it is outputted
9
+
10
+
11
+ Scenario: Stringify a directory model
12
+ When the model is output as a string
13
+ """
14
+ @model.to_s
15
+ """
9
16
  Then the following text is provided:
10
17
  """
11
18
  <path_to>/some_directory
12
19
  """
13
20
  And the output can be used to make an equivalent model
14
21
  """
15
- CukeModeler::Directory.new(@model.to_s)
22
+ CukeModeler::Directory.new(@model.to_s)
23
+ """
24
+
25
+ Scenario: Inspect a directory model
26
+ When the model is inspected
27
+ """
28
+ @model.inspect
29
+ """
30
+ Then the following text is provided:
31
+ """
32
+ #<CukeModeler::Directory:<object_id> @path: "<path_to>/some_directory">
16
33
  """
@@ -1,9 +1,10 @@
1
1
  Feature: Doc string output
2
2
 
3
- A doc string model's string output is a Gherkin representation of itself. As such, output from a doc string model can be used as input for the same kind of model.
3
+ A doc string model's string output is a Gherkin representation of itself and its most relevant attribute for
4
+ inspection is the content of the doc string that it models.
4
5
 
5
6
 
6
- Scenario: Outputting a doc string model
7
+ Background:
7
8
  Given the following gherkin:
8
9
  """
9
10
  \"\"\" type foo
@@ -15,11 +16,14 @@ Feature: Doc string output
15
16
  """
16
17
  And a doc string model based on that gherkin
17
18
  """
18
- @model = CukeModeler::DocString.new(<source_text>)
19
+ @model = CukeModeler::DocString.new(<source_text>)
19
20
  """
21
+
22
+
23
+ Scenario: Stringify a doc string model
20
24
  When the model is output as a string
21
25
  """
22
- @model.to_s
26
+ @model.to_s
23
27
  """
24
28
  Then the following text is provided:
25
29
  """
@@ -32,5 +36,15 @@ Feature: Doc string output
32
36
  """
33
37
  And the output can be used to make an equivalent model
34
38
  """
35
- CukeModeler::DocString.new(@model.to_s)
39
+ CukeModeler::DocString.new(@model.to_s)
40
+ """
41
+
42
+ Scenario: Inspect a doc string model
43
+ When the model is inspected
44
+ """
45
+ @model.inspect
46
+ """
47
+ Then the following text is provided:
48
+ """
49
+ #<CukeModeler::DocString:<object_id> @content: "Some text\n\n some more text\n">
36
50
  """
@@ -1,14 +1,15 @@
1
1
  Feature: Example output
2
2
 
3
- An example model's string output is a Gherkin representation of itself. As such, output from an example model can be used as input for the same kind of model.
3
+ An example model's string output is a Gherkin representation of itself and its most relevant attribute for
4
+ inspection is the name of the example that it models.
4
5
 
5
6
 
6
- Scenario: Outputting an example model
7
+ Background:
7
8
  Given the following gherkin:
8
9
  """
9
10
  @tag1
10
11
  @tag2 @tag3
11
- Examples: an example with everything that it could have
12
+ Examples: An example with everything that it could have
12
13
 
13
14
  Some description.
14
15
  Some more description.
@@ -19,16 +20,19 @@ Feature: Example output
19
20
  """
20
21
  And an example model based on that gherkin
21
22
  """
22
- @model = CukeModeler::Example.new(<source_text>)
23
+ @model = CukeModeler::Example.new(<source_text>)
23
24
  """
25
+
26
+
27
+ Scenario: Stringify an example model
24
28
  When the model is output as a string
25
29
  """
26
- @model.to_s
30
+ @model.to_s
27
31
  """
28
32
  Then the following text is provided:
29
33
  """
30
34
  @tag1 @tag2 @tag3
31
- Examples: an example with everything that it could have
35
+ Examples: An example with everything that it could have
32
36
 
33
37
  Some description.
34
38
  Some more description.
@@ -39,5 +43,15 @@ Feature: Example output
39
43
  """
40
44
  And the output can be used to make an equivalent model
41
45
  """
42
- CukeModeler::Example.new(@model.to_s)
46
+ CukeModeler::Example.new(@model.to_s)
47
+ """
48
+
49
+ Scenario: Inspect an example model
50
+ When the model is inspected
51
+ """
52
+ @model.inspect
53
+ """
54
+ Then the following text is provided:
55
+ """
56
+ #<CukeModeler::Example:<object_id> @name: "An example with everything that it could have">
43
57
  """
@@ -1,16 +1,33 @@
1
1
  Feature: Feature file output
2
2
 
3
- A feature file model's string output is simply the file path of the feature file that it models. As such, output from a feature file model can be used as input for the same kind of model.
3
+ A feature file model's string output is simply the file path of the feature file that it models and its
4
+ most relevant attribute for inspection is the path of the feature file that it models.
4
5
 
5
6
 
6
- Scenario: Outputting a feature file model
7
+ Background:
7
8
  Given a feature file model based on "some_feature_file.feature"
8
- When it is outputted
9
+
10
+
11
+ Scenario: Stringify a feature file model
12
+ When the model is output as a string
13
+ """
14
+ @model.to_s
15
+ """
9
16
  Then the following text is provided:
10
17
  """
11
18
  <path_to>/some_feature_file.feature
12
19
  """
13
20
  And the output can be used to make an equivalent model
14
21
  """
15
- CukeModeler::FeatureFile.new(@model.to_s)
22
+ CukeModeler::FeatureFile.new(@model.to_s)
23
+ """
24
+
25
+ Scenario: Inspect a feature file model
26
+ When the model is inspected
27
+ """
28
+ @model.inspect
29
+ """
30
+ Then the following text is provided:
31
+ """
32
+ #<CukeModeler::FeatureFile:<object_id> @path: "<path_to>/some_feature_file.feature">
16
33
  """
@@ -1,9 +1,10 @@
1
1
  Feature: Feature output
2
2
 
3
- A feature model's string output is a Gherkin representation of itself. As such, output from a feature model can be used as input for the same kind of model.
3
+ A feature model's string output is a Gherkin representation of itself and its most relevant attribute for
4
+ inspection is the name of the feature that it models.
4
5
 
5
6
 
6
- Scenario: Outputting a feature model
7
+ Background:
7
8
  Given the following gherkin:
8
9
  """
9
10
  @tag1@tag2
@@ -28,7 +29,7 @@ Feature: Feature output
28
29
  some text
29
30
  \"\"\"
30
31
  Rule: a rule
31
- Rule description
32
+ Rule description
32
33
  Background: nested background
33
34
  * a step
34
35
  @outline_tag
@@ -53,11 +54,14 @@ Feature: Feature output
53
54
  """
54
55
  And a feature model based on that gherkin
55
56
  """
56
- @model = CukeModeler::Feature.new(<source_text>)
57
+ @model = CukeModeler::Feature.new(<source_text>)
57
58
  """
59
+
60
+
61
+ Scenario: Stringify a feature model
58
62
  When the model is output as a string
59
63
  """
60
- @model.to_s
64
+ @model.to_s
61
65
  """
62
66
  Then the following text is provided:
63
67
  """
@@ -126,5 +130,15 @@ Feature: Feature output
126
130
  """
127
131
  And the output can be used to make an equivalent model
128
132
  """
129
- CukeModeler::Feature.new(@model.to_s)
133
+ CukeModeler::Feature.new(@model.to_s)
134
+ """
135
+
136
+ Scenario: Inspect a feature model
137
+ When the model is inspected
138
+ """
139
+ @model.inspect
140
+ """
141
+ Then the following text is provided:
142
+ """
143
+ #<CukeModeler::Feature:<object_id> @name: "A feature with everything it could have">
130
144
  """
@@ -1,13 +1,61 @@
1
1
  Feature: Model output
2
2
 
3
- All models can be output in text form. For models that represent parts of the file structure, this text will be a path and for models that represent parts of a feature file, this text will be Gherkin (see the model output documentation for specific models for details).
3
+ All models can be output in text form via `#to_s`. For models that represent parts of the file structure, this text
4
+ usually is a path. For models that represent parts of a feature file, this text usually is Gherkin. In any case, the
5
+ output is in a format that can be used to create the same kind of model.
4
6
 
7
+ Due to the nested nature of model relationships, the default output of `#inspect` can get...lengthy. For this reason,
8
+ all models override `#inspect` to make it provide a minimal but useful amount of information on the model object.
9
+ Switching between the minimal and the verbose (i.e. default Ruby behavior) version is controlled by a flag.
5
10
 
6
- Scenario: Outputting a model
11
+ See the model output documentation for specific models for details.
12
+
13
+
14
+ Scenario: Stringify a model
7
15
  Given the models provided by CukeModeler
8
- Then all of them can be output as text appropriate to the model type
16
+ Then all of them can be output as text appropriate to the model type
9
17
  """
10
- model = <model_class>.new
18
+ model = <model_class>.new
11
19
 
12
- model.to_s
20
+ model.to_s
21
+ """
22
+
23
+ Scenario: Inspect a model
24
+
25
+ Note: The base model class, `CukeModeler::Model` lacks any "meaningful attributes"
26
+
27
+ Given the models provided by CukeModeler
28
+ Then all of them can provide a custom inspection output
29
+ """
30
+ model = <model_class>.new
31
+
32
+ model.inspect
33
+ """
34
+ And the inspection values are of the form:
13
35
  """
36
+ #<CukeModeler::<model_class>:<object_id> <some_meaningful_attribute>: <attribute_value>>
37
+ """
38
+ But the base model class inspection value is of the form:
39
+ """
40
+ #<CukeModeler::<model_class>:<object_id>>
41
+ """
42
+
43
+ Scenario: Controlling inspection output
44
+
45
+ Note: Non-verbose inspection is the default behavior for models
46
+
47
+ Given the models provided by CukeModeler
48
+ When using non-verbose inspection
49
+ """
50
+ model = <model_class>.new
51
+
52
+ model.inspect(verbose: false)
53
+ """
54
+ Then the custom model inspection is used
55
+ When using verbose inspection
56
+ """
57
+ model = <model_class>.new
58
+
59
+ model.inspect(verbose: true)
60
+ """
61
+ Then the default Ruby inspection is used
@@ -1,9 +1,10 @@
1
1
  Feature: Outline output
2
2
 
3
- An outline model's string output is a Gherkin representation of itself. As such, output from an outline model can be used as input for the same kind of model.
3
+ An outline model's string output is a Gherkin representation of itself and its most relevant attribute for
4
+ inspection is the name of the outline that it models.
4
5
 
5
6
 
6
- Scenario: Outputting an outline model
7
+ Background:
7
8
  Given the following gherkin:
8
9
  """
9
10
  @tag1@tag2
@@ -33,11 +34,14 @@ Feature: Outline output
33
34
  """
34
35
  And an outline model based on that gherkin
35
36
  """
36
- @model = CukeModeler::Outline.new(<source_text>)
37
+ @model = CukeModeler::Outline.new(<source_text>)
37
38
  """
39
+
40
+
41
+ Scenario: Stringify an outline model
38
42
  When the model is output as a string
39
43
  """
40
- @model.to_s
44
+ @model.to_s
41
45
  """
42
46
  Then the following text is provided:
43
47
  """
@@ -69,5 +73,15 @@ Feature: Outline output
69
73
  """
70
74
  And the output can be used to make an equivalent model
71
75
  """
72
- CukeModeler::Outline.new(@model.to_s)
76
+ CukeModeler::Outline.new(@model.to_s)
77
+ """
78
+
79
+ Scenario: Inspect an outline model
80
+ When the model is inspected
81
+ """
82
+ @model.inspect
83
+ """
84
+ Then the following text is provided:
85
+ """
86
+ #<CukeModeler::Outline:<object_id> @name: "An outline with everything that it could have">
73
87
  """
@@ -1,20 +1,24 @@
1
1
  Feature: Row output
2
2
 
3
- A row model's string output is a Gherkin representation of itself. As such, output from a row model can be used as input for the same kind of model.
3
+ A row model's string output is a Gherkin representation of itself and its most relevant attribute for
4
+ inspection is the collection of cells of the row that it models.
4
5
 
5
6
 
6
- Scenario: Outputting a row model
7
+ Background:
7
8
  Given the following gherkin:
8
9
  """
9
10
  |foo|bar|
10
11
  """
11
12
  And a row model based on that gherkin
12
13
  """
13
- @model = CukeModeler::Row.new(<source_text>)
14
+ @model = CukeModeler::Row.new(<source_text>)
14
15
  """
16
+
17
+
18
+ Scenario: Stringify a row model
15
19
  When the model is output as a string
16
20
  """
17
- @model.to_s
21
+ @model.to_s
18
22
  """
19
23
  Then the following text is provided:
20
24
  """
@@ -22,5 +26,15 @@ Feature: Row output
22
26
  """
23
27
  And the output can be used to make an equivalent model
24
28
  """
25
- CukeModeler::Row.new(@model.to_s)
29
+ CukeModeler::Row.new(@model.to_s)
30
+ """
31
+
32
+ Scenario: Inspect a row model
33
+ When the model is inspected
34
+ """
35
+ @model.inspect
36
+ """
37
+ Then the following text is provided:
38
+ """
39
+ #<CukeModeler::Row:<object_id> @cells: ["foo", "bar"]>
26
40
  """
@@ -1,11 +1,11 @@
1
1
  Feature: Rule output
2
2
 
3
- A rule model's string output is a Gherkin representation of itself. As such, output from a rule model can be used as
4
- input for the same kind of model.
3
+ A rule model's string output is a Gherkin representation of itself and its most relevant attribute for
4
+ inspection is the name of the rule that it models.
5
5
 
6
6
 
7
7
  @gherkin_min_version_18
8
- Scenario: Outputting a rule model
8
+ Scenario: Stringify a rule model
9
9
  Given the following gherkin:
10
10
  """
11
11
  @tag1@tag2
@@ -49,11 +49,11 @@ Feature: Rule output
49
49
  """
50
50
  And a rule model based on that gherkin
51
51
  """
52
- @model = CukeModeler::Rule.new(<source_text>)
52
+ @model = CukeModeler::Rule.new(<source_text>)
53
53
  """
54
54
  When the model is output as a string
55
55
  """
56
- @model.to_s
56
+ @model.to_s
57
57
  """
58
58
  Then the following text is provided:
59
59
  """
@@ -111,5 +111,26 @@ Feature: Rule output
111
111
  """
112
112
  And the output can be used to make an equivalent model
113
113
  """
114
- CukeModeler::Rule.new(@model.to_s)
114
+ CukeModeler::Rule.new(@model.to_s)
115
+ """
116
+
117
+ Scenario: Inspect a rule model
118
+ Given the following gherkin:
119
+ """
120
+ Rule: some rule
121
+
122
+ Scenario: a scenario
123
+ * a step
124
+ """
125
+ And a rule model based on that gherkin
126
+ """
127
+ @model = CukeModeler::Rule.new(<source_text>)
128
+ """
129
+ When the model is inspected
130
+ """
131
+ @model.inspect
132
+ """
133
+ Then the following text is provided:
134
+ """
135
+ #<CukeModeler::Rule:<object_id> @name: "some rule">
115
136
  """
@@ -1,9 +1,10 @@
1
1
  Feature: Scenario output
2
2
 
3
- A scenario model's string output is a Gherkin representation of itself. As such, output from a scenario model can be used as input for the same kind of model.
3
+ A scenario model's string output is a Gherkin representation of itself and its most relevant attribute for
4
+ inspection is the name of the scenario that it models.
4
5
 
5
6
 
6
- Scenario: Outputting a scenario model
7
+ Background:
7
8
  Given the following gherkin:
8
9
  """
9
10
  @tag1@tag2
@@ -22,11 +23,14 @@ Feature: Scenario output
22
23
  """
23
24
  And a scenario model based on that gherkin
24
25
  """
25
- @model = CukeModeler::Scenario.new(<source_text>)
26
+ @model = CukeModeler::Scenario.new(<source_text>)
26
27
  """
28
+
29
+
30
+ Scenario: Stringify a scenario model
27
31
  When the model is output as a string
28
32
  """
29
- @model.to_s
33
+ @model.to_s
30
34
  """
31
35
  Then the following text is provided:
32
36
  """
@@ -45,5 +49,15 @@ Feature: Scenario output
45
49
  """
46
50
  And the output can be used to make an equivalent model
47
51
  """
48
- CukeModeler::Scenario.new(@model.to_s)
52
+ CukeModeler::Scenario.new(@model.to_s)
53
+ """
54
+
55
+ Scenario: Inspect a scenario model
56
+ When the model is inspected
57
+ """
58
+ @model.inspect
59
+ """
60
+ Then the following text is provided:
61
+ """
62
+ #<CukeModeler::Scenario:<object_id> @name: "A scenario with everything that it could have">
49
63
  """
@@ -1,9 +1,10 @@
1
1
  Feature: Step output
2
2
 
3
- A step model's string output is a Gherkin representation of itself. As such, output from a step model can be used as input for the same kind of model.
3
+ A step model's string output is a Gherkin representation of itself and its most relevant attribute for
4
+ inspection is the text of the step that it models.
4
5
 
5
6
 
6
- Scenario: Outputting a step model
7
+ Background:
7
8
 
8
9
  Note: Outputting a step that has a doc string is accomplished in the same manner
9
10
 
@@ -15,11 +16,14 @@ Feature: Step output
15
16
  """
16
17
  And a step model based on that gherkin
17
18
  """
18
- @model = CukeModeler::Step.new(<source_text>)
19
+ @model = CukeModeler::Step.new(<source_text>)
19
20
  """
21
+
22
+
23
+ Scenario: Stringify a step model
20
24
  When the model is output as a string
21
25
  """
22
- @model.to_s
26
+ @model.to_s
23
27
  """
24
28
  Then the following text is provided:
25
29
  """
@@ -29,5 +33,15 @@ Feature: Step output
29
33
  """
30
34
  And the output can be used to make an equivalent model
31
35
  """
32
- CukeModeler::Step.new(@model.to_s)
36
+ CukeModeler::Step.new(@model.to_s)
37
+ """
38
+
39
+ Scenario: Inspect a step model
40
+ When the model is inspected
41
+ """
42
+ @model.inspect
43
+ """
44
+ Then the following text is provided:
45
+ """
46
+ #<CukeModeler::Step:<object_id> @text: "a step">
33
47
  """
@@ -1,9 +1,10 @@
1
1
  Feature: Table output
2
2
 
3
- A table model's string output is a Gherkin representation of itself. As such, output from a table model can be used as input for the same kind of model.
3
+ A table model's string output is a Gherkin representation of itself and its most relevant attribute for
4
+ inspection is the collection of rows of the table that it models.
4
5
 
5
6
 
6
- Scenario: Outputting a table model
7
+ Background:
7
8
  Given the following gherkin:
8
9
  """
9
10
  |value1|value2|
@@ -11,8 +12,11 @@ Feature: Table output
11
12
  """
12
13
  And a table model based on that gherkin
13
14
  """
14
- @model = CukeModeler::Table.new(<source_text>)
15
+ @model = CukeModeler::Table.new(<source_text>)
15
16
  """
17
+
18
+
19
+ Scenario: Stringify a table model
16
20
  When the model is output as a string
17
21
  """
18
22
  @model.to_s
@@ -24,5 +28,15 @@ Feature: Table output
24
28
  """
25
29
  And the output can be used to make an equivalent model
26
30
  """
27
- CukeModeler::Table.new(@model.to_s)
31
+ CukeModeler::Table.new(@model.to_s)
32
+ """
33
+
34
+ Scenario: Inspect a table model
35
+ When the model is inspected
36
+ """
37
+ @model.inspect
38
+ """
39
+ Then the following text is provided:
40
+ """
41
+ #<CukeModeler::Table:<object_id> @rows: [["value1", "value2"], ["value3", "value4"]]>
28
42
  """
@@ -1,20 +1,24 @@
1
1
  Feature: Tag output
2
2
 
3
- A tag model's string output is a Gherkin representation of itself. As such, output from a tag model can be used as input for the same kind of model.
3
+ A tag model's string output is a Gherkin representation of itself and its most relevant attribute for
4
+ inspection is the name of the tag that it models.
4
5
 
5
6
 
6
- Scenario: Outputting a tag model
7
+ Background:
7
8
  Given the following gherkin:
8
9
  """
9
10
  @a_tag
10
11
  """
11
12
  And a tag model based on that gherkin
12
13
  """
13
- @model = CukeModeler::Tag.new(<source_text>)
14
+ @model = CukeModeler::Tag.new(<source_text>)
14
15
  """
16
+
17
+
18
+ Scenario: Stringify a tag model
15
19
  When the model is output as a string
16
20
  """
17
- @model.to_s
21
+ @model.to_s
18
22
  """
19
23
  Then the following text is provided:
20
24
  """
@@ -22,5 +26,15 @@ Feature: Tag output
22
26
  """
23
27
  And the output can be used to make an equivalent model
24
28
  """
25
- CukeModeler::Tag.new(@model.to_s)
29
+ CukeModeler::Tag.new(@model.to_s)
30
+ """
31
+
32
+ Scenario: Inspect a tag model
33
+ When the model is inspected
34
+ """
35
+ @model.inspect
36
+ """
37
+ Then the following text is provided:
38
+ """
39
+ #<CukeModeler::Tag:<object_id> @name: "@a_tag">
26
40
  """