cucumber_analytics 1.5.1 → 1.5.2
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.
- data/History.rdoc +6 -0
- data/Rakefile +10 -27
- data/cucumber_analytics.gemspec +1 -0
- data/features/modeling/background_modeling.feature +0 -11
- data/features/modeling/directory_modeling.feature +0 -11
- data/features/modeling/doc_string_modeling.feature +0 -11
- data/features/modeling/example_modeling.feature +0 -11
- data/features/modeling/feature_file_modeling.feature +0 -11
- data/features/modeling/feature_modeling.feature +0 -11
- data/features/modeling/outline_modeling.feature +0 -11
- data/features/modeling/row_modeling.feature +0 -10
- data/features/modeling/scenario_modeling.feature +0 -11
- data/features/modeling/step_modeling.feature +0 -11
- data/features/modeling/table_modeling.feature +0 -11
- data/features/modeling/table_row_modeling.feature +0 -11
- data/features/modeling/tag_modeling.feature +0 -11
- data/features/step_definitions/background_steps.rb +4 -4
- data/features/step_definitions/directory_steps.rb +1 -1
- data/features/step_definitions/doc_string_steps.rb +6 -6
- data/features/step_definitions/feature_file_steps.rb +1 -1
- data/features/step_definitions/feature_steps.rb +11 -11
- data/features/step_definitions/outline_steps.rb +18 -18
- data/features/step_definitions/step_steps.rb +6 -6
- data/features/step_definitions/table_steps.rb +6 -6
- data/features/step_definitions/tag_steps.rb +10 -10
- data/features/step_definitions/test_steps.rb +8 -8
- data/features/step_definitions/verification_steps.rb +2 -2
- data/features/step_definitions/world_steps.rb +8 -8
- data/lib/cucumber_analytics/step.rb +3 -1
- data/lib/cucumber_analytics/test_element.rb +2 -0
- data/lib/cucumber_analytics/version.rb +1 -1
- data/spec/integration/background_integration_spec.rb +5 -5
- data/spec/integration/directory_integration_spec.rb +4 -4
- data/spec/integration/doc_string_integration_spec.rb +6 -6
- data/spec/integration/example_integration_spec.rb +8 -8
- data/spec/integration/feature_file_integration_spec.rb +3 -3
- data/spec/integration/feature_integration_spec.rb +15 -15
- data/spec/integration/outline_integration_spec.rb +7 -7
- data/spec/integration/scenario_integration_spec.rb +6 -6
- data/spec/integration/step_integration_spec.rb +16 -17
- data/spec/integration/table_integration_spec.rb +8 -8
- data/spec/integration/table_row_integration_spec.rb +7 -7
- data/spec/integration/tag_integration_spec.rb +6 -6
- data/spec/integration/world_integration_spec.rb +2 -2
- data/spec/unit/background_unit_spec.rb +2 -2
- data/spec/unit/containing_element_unit_specs.rb +2 -2
- data/spec/unit/directory_unit_spec.rb +14 -14
- data/spec/unit/doc_string_unit_spec.rb +18 -18
- data/spec/unit/example_unit_spec.rb +32 -32
- data/spec/unit/feature_element_unit_specs.rb +12 -12
- data/spec/unit/feature_file_unit_spec.rb +12 -12
- data/spec/unit/feature_unit_spec.rb +16 -16
- data/spec/unit/nested_element_unit_specs.rb +6 -6
- data/spec/unit/nested_unit_spec.rb +5 -5
- data/spec/unit/outline_unit_spec.rb +7 -7
- data/spec/unit/parsing_unit_spec.rb +4 -4
- data/spec/unit/prepopulated_unit_specs.rb +1 -1
- data/spec/unit/raw_element_unit_specs.rb +4 -4
- data/spec/unit/raw_unit_spec.rb +3 -3
- data/spec/unit/row_unit_spec.rb +6 -6
- data/spec/unit/scenario_unit_spec.rb +3 -3
- data/spec/unit/sourceable_unit_spec.rb +1 -1
- data/spec/unit/sourced_element_unit_specs.rb +2 -2
- data/spec/unit/step_unit_spec.rb +53 -44
- data/spec/unit/table_row_unit_spec.rb +6 -6
- data/spec/unit/table_unit_spec.rb +14 -14
- data/spec/unit/tag_unit_spec.rb +5 -5
- data/spec/unit/taggable_unit_spec.rb +14 -14
- data/spec/unit/tagged_element_unit_specs.rb +14 -14
- data/spec/unit/test_element_unit_spec.rb +11 -3
- data/spec/unit/test_element_unit_specs.rb +5 -5
- data/spec/unit/world_unit_spec.rb +26 -26
- metadata +26 -5
- data/features/step_definitions/spec_steps.rb +0 -18
@@ -14,7 +14,7 @@ describe 'FeatureFile, Integration' do
|
|
14
14
|
file = CucumberAnalytics::FeatureFile.new(file_path)
|
15
15
|
feature = file.feature
|
16
16
|
|
17
|
-
feature.parent_element.
|
17
|
+
expect(feature.parent_element).to be(file)
|
18
18
|
end
|
19
19
|
|
20
20
|
context 'getting stuff' do
|
@@ -31,13 +31,13 @@ describe 'FeatureFile, Integration' do
|
|
31
31
|
it 'can get its directory' do
|
32
32
|
directory = @feature_file.get_ancestor(:directory)
|
33
33
|
|
34
|
-
directory.
|
34
|
+
expect(directory).to be(@directory)
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'returns nil if it does not have the requested type of ancestor' do
|
38
38
|
example = @feature_file.get_ancestor(:example)
|
39
39
|
|
40
|
-
example.
|
40
|
+
expect(example).to be_nil
|
41
41
|
end
|
42
42
|
|
43
43
|
end
|
@@ -26,10 +26,10 @@ describe 'Feature, Integration' do
|
|
26
26
|
tag = feature.tag_elements[0]
|
27
27
|
|
28
28
|
|
29
|
-
outline.parent_element.
|
30
|
-
scenario.parent_element.
|
31
|
-
background.parent_element.
|
32
|
-
tag.parent_element.
|
29
|
+
expect(outline.parent_element).to be(feature)
|
30
|
+
expect(scenario.parent_element).to be(feature)
|
31
|
+
expect(background.parent_element).to be(feature)
|
32
|
+
expect(tag.parent_element).to be(feature)
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'can distinguish scenarios from outlines - #scenarios, #outlines' do
|
@@ -38,8 +38,8 @@ describe 'Feature, Integration' do
|
|
38
38
|
|
39
39
|
@feature.tests = scenarios + outlines
|
40
40
|
|
41
|
-
@feature.scenarios.
|
42
|
-
@feature.outlines.
|
41
|
+
expect(@feature.scenarios).to match_array(scenarios)
|
42
|
+
expect(@feature.outlines).to match_array(outlines)
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'knows how many scenarios it has - #scenario_count' do
|
@@ -47,10 +47,10 @@ describe 'Feature, Integration' do
|
|
47
47
|
outlines = [CucumberAnalytics::Outline.new('Scenario Outline: 1')]
|
48
48
|
|
49
49
|
@feature.tests = []
|
50
|
-
@feature.scenario_count.
|
50
|
+
expect(@feature.scenario_count).to eq(0)
|
51
51
|
|
52
52
|
@feature.tests = scenarios + outlines
|
53
|
-
@feature.scenario_count.
|
53
|
+
expect(@feature.scenario_count).to eq(2)
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'knows how many outlines it has - #outline_count' do
|
@@ -58,10 +58,10 @@ describe 'Feature, Integration' do
|
|
58
58
|
outlines = [CucumberAnalytics::Outline.new('Scenario Outline: 1'), CucumberAnalytics::Outline.new('Scenario Outline: 2')]
|
59
59
|
|
60
60
|
@feature.tests = []
|
61
|
-
@feature.outline_count.
|
61
|
+
expect(@feature.outline_count).to eq(0)
|
62
62
|
|
63
63
|
@feature.tests = scenarios + outlines
|
64
|
-
@feature.outline_count.
|
64
|
+
expect(@feature.outline_count).to eq(2)
|
65
65
|
end
|
66
66
|
|
67
67
|
it 'knows how many test cases it has - #test_case_count' do
|
@@ -82,8 +82,8 @@ describe 'Feature, Integration' do
|
|
82
82
|
feature_2 = CucumberAnalytics::Feature.new(source_2)
|
83
83
|
|
84
84
|
|
85
|
-
feature_1.test_case_count.
|
86
|
-
feature_2.test_case_count.
|
85
|
+
expect(feature_1.test_case_count).to eq(0)
|
86
|
+
expect(feature_2.test_case_count).to eq(3)
|
87
87
|
end
|
88
88
|
|
89
89
|
|
@@ -104,19 +104,19 @@ describe 'Feature, Integration' do
|
|
104
104
|
it 'can get its directory' do
|
105
105
|
directory = @feature.get_ancestor(:directory)
|
106
106
|
|
107
|
-
directory.
|
107
|
+
expect(directory).to be(@directory)
|
108
108
|
end
|
109
109
|
|
110
110
|
it 'can get its feature file' do
|
111
111
|
feature_file = @feature.get_ancestor(:feature_file)
|
112
112
|
|
113
|
-
feature_file.
|
113
|
+
expect(feature_file).to be(@directory.feature_files.first)
|
114
114
|
end
|
115
115
|
|
116
116
|
it 'returns nil if it does not have the requested type of ancestor' do
|
117
117
|
test = @feature.get_ancestor(:test)
|
118
118
|
|
119
|
-
test.
|
119
|
+
expect(test).to be_nil
|
120
120
|
end
|
121
121
|
|
122
122
|
end
|
@@ -17,9 +17,9 @@ describe 'Outline, Integration' do
|
|
17
17
|
step = outline.steps.first
|
18
18
|
tag = outline.tag_elements.first
|
19
19
|
|
20
|
-
example.parent_element.
|
21
|
-
step.parent_element.
|
22
|
-
tag.parent_element.
|
20
|
+
expect(example.parent_element).to be(outline)
|
21
|
+
expect(step.parent_element).to be(outline)
|
22
|
+
expect(tag.parent_element).to be(outline)
|
23
23
|
end
|
24
24
|
|
25
25
|
|
@@ -45,25 +45,25 @@ describe 'Outline, Integration' do
|
|
45
45
|
it 'can get its directory' do
|
46
46
|
directory = @outline.get_ancestor(:directory)
|
47
47
|
|
48
|
-
directory.
|
48
|
+
expect(directory).to be(@directory)
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'can get its feature file' do
|
52
52
|
feature_file = @outline.get_ancestor(:feature_file)
|
53
53
|
|
54
|
-
feature_file.
|
54
|
+
expect(feature_file).to be(@directory.feature_files.first)
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'can get its feature' do
|
58
58
|
feature = @outline.get_ancestor(:feature)
|
59
59
|
|
60
|
-
feature.
|
60
|
+
expect(feature).to be(@directory.feature_files.first.features.first)
|
61
61
|
end
|
62
62
|
|
63
63
|
it 'returns nil if it does not have the requested type of ancestor' do
|
64
64
|
test = @outline.get_ancestor(:test)
|
65
65
|
|
66
|
-
test.
|
66
|
+
expect(test).to be_nil
|
67
67
|
end
|
68
68
|
|
69
69
|
context 'outline output edge cases' do
|
@@ -14,8 +14,8 @@ describe 'Scenario, Integration' do
|
|
14
14
|
step = scenario.steps.first
|
15
15
|
tag = scenario.tag_elements.first
|
16
16
|
|
17
|
-
step.parent_element.
|
18
|
-
tag.parent_element.
|
17
|
+
expect(step.parent_element).to be(scenario)
|
18
|
+
expect(tag.parent_element).to be(scenario)
|
19
19
|
end
|
20
20
|
|
21
21
|
|
@@ -39,25 +39,25 @@ describe 'Scenario, Integration' do
|
|
39
39
|
it 'can get its directory' do
|
40
40
|
directory = @scenario.get_ancestor(:directory)
|
41
41
|
|
42
|
-
directory.
|
42
|
+
expect(directory).to be(@directory)
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'can get its feature file' do
|
46
46
|
feature_file = @scenario.get_ancestor(:feature_file)
|
47
47
|
|
48
|
-
feature_file.
|
48
|
+
expect(feature_file).to be(@directory.feature_files.first)
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'can get its feature' do
|
52
52
|
feature = @scenario.get_ancestor(:feature)
|
53
53
|
|
54
|
-
feature.
|
54
|
+
expect(feature).to be(@directory.feature_files.first.features.first)
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'returns nil if it does not have the requested type of ancestor' do
|
58
58
|
test = @scenario.get_ancestor(:test)
|
59
59
|
|
60
|
-
test.
|
60
|
+
expect(test).to be_nil
|
61
61
|
end
|
62
62
|
|
63
63
|
context 'scenario output edge cases' do
|
@@ -19,8 +19,8 @@ describe 'Step, Integration' do
|
|
19
19
|
doc_string = step_1.block
|
20
20
|
table = step_2.block
|
21
21
|
|
22
|
-
doc_string.parent_element.
|
23
|
-
table.parent_element.
|
22
|
+
expect(doc_string.parent_element).to be(step_1)
|
23
|
+
expect(table.parent_element).to be(step_2)
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'defaults to the World delimiters if its own are not set' do
|
@@ -32,8 +32,8 @@ describe 'Step, Integration' do
|
|
32
32
|
step.right_delimiter = nil
|
33
33
|
step.left_delimiter = nil
|
34
34
|
|
35
|
-
step.right_delimiter.
|
36
|
-
step.left_delimiter.
|
35
|
+
expect(step.right_delimiter).to eq('"')
|
36
|
+
expect(step.left_delimiter).to eq('"')
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'attempts to determine its arguments during creation' do
|
@@ -45,7 +45,7 @@ describe 'Step, Integration' do
|
|
45
45
|
|
46
46
|
step = CucumberAnalytics::Step.new(source)
|
47
47
|
|
48
|
-
step.arguments.
|
48
|
+
expect(step.arguments).to eq(['parameter 2'])
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'finds nothing when no regular expression or delimiters are available' do
|
@@ -58,7 +58,7 @@ describe 'Step, Integration' do
|
|
58
58
|
|
59
59
|
step.scan_arguments
|
60
60
|
|
61
|
-
step.arguments.
|
61
|
+
expect(step.arguments).to eq([])
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'can determine its equality with another Step' do
|
@@ -74,9 +74,8 @@ describe 'Step, Integration' do
|
|
74
74
|
step_2.delimiter = '*'
|
75
75
|
step_3.delimiter = '*'
|
76
76
|
|
77
|
-
|
78
|
-
(step_1
|
79
|
-
(step_1 == step_3).should be_false
|
77
|
+
expect(step_1).to eq(step_2)
|
78
|
+
expect(step_1).to_not eq(step_3)
|
80
79
|
end
|
81
80
|
|
82
81
|
context '#step_text ' do
|
@@ -94,21 +93,21 @@ describe 'Step, Integration' do
|
|
94
93
|
expected_output = ['Given a test step with -parameter 1- ^and@ *parameter 2!!',
|
95
94
|
'|a block|']
|
96
95
|
|
97
|
-
step_with_block.step_text.
|
96
|
+
expect(step_with_block.step_text).to eq(expected_output)
|
98
97
|
|
99
98
|
source = 'Given a test step with -parameter 1- ^and@ *parameter 2!!'
|
100
99
|
step_without_block = CucumberAnalytics::Step.new(source)
|
101
100
|
|
102
101
|
expected_output = ['Given a test step with -parameter 1- ^and@ *parameter 2!!']
|
103
102
|
|
104
|
-
step_without_block.step_text.
|
103
|
+
expect(step_without_block.step_text).to eq(expected_output)
|
105
104
|
end
|
106
105
|
|
107
106
|
it 'can provide the step\'s text without the keyword' do
|
108
107
|
expected_output = ['a test step with -parameter 1- ^and@ *parameter 2!!',
|
109
108
|
'|a block|']
|
110
109
|
|
111
|
-
@step.step_text(:with_keywords => false).
|
110
|
+
expect(@step.step_text(:with_keywords => false)).to eq(expected_output)
|
112
111
|
end
|
113
112
|
|
114
113
|
end
|
@@ -133,31 +132,31 @@ describe 'Step, Integration' do
|
|
133
132
|
it 'can get its directory' do
|
134
133
|
directory = @step.get_ancestor(:directory)
|
135
134
|
|
136
|
-
directory.
|
135
|
+
expect(directory).to be(@directory)
|
137
136
|
end
|
138
137
|
|
139
138
|
it 'can get its feature file' do
|
140
139
|
feature_file = @step.get_ancestor(:feature_file)
|
141
140
|
|
142
|
-
feature_file.
|
141
|
+
expect(feature_file).to be(@directory.feature_files.first)
|
143
142
|
end
|
144
143
|
|
145
144
|
it 'can get its feature' do
|
146
145
|
feature = @step.get_ancestor(:feature)
|
147
146
|
|
148
|
-
feature.
|
147
|
+
expect(feature).to be(@directory.feature_files.first.features.first)
|
149
148
|
end
|
150
149
|
|
151
150
|
it 'can get its test' do
|
152
151
|
test = @step.get_ancestor(:test)
|
153
152
|
|
154
|
-
test.
|
153
|
+
expect(test).to be(@directory.feature_files.first.features.first.tests.first)
|
155
154
|
end
|
156
155
|
|
157
156
|
it 'returns nil if it does not have the requested type of ancestor' do
|
158
157
|
example = @step.get_ancestor(:example)
|
159
158
|
|
160
|
-
example.
|
159
|
+
expect(example).to be_nil
|
161
160
|
end
|
162
161
|
|
163
162
|
end
|
@@ -13,8 +13,8 @@ describe 'Table, Integration' do
|
|
13
13
|
row_1 = table.row_elements[0]
|
14
14
|
row_2 = table.row_elements[1]
|
15
15
|
|
16
|
-
row_1.parent_element.
|
17
|
-
row_2.parent_element.
|
16
|
+
expect(row_1.parent_element).to be(table)
|
17
|
+
expect(row_2.parent_element).to be(table)
|
18
18
|
end
|
19
19
|
|
20
20
|
context 'getting stuff' do
|
@@ -38,37 +38,37 @@ describe 'Table, Integration' do
|
|
38
38
|
it 'can get its directory' do
|
39
39
|
directory = @table.get_ancestor(:directory)
|
40
40
|
|
41
|
-
directory.
|
41
|
+
expect(directory).to be(@directory)
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'can get its feature file' do
|
45
45
|
feature_file = @table.get_ancestor(:feature_file)
|
46
46
|
|
47
|
-
feature_file.
|
47
|
+
expect(feature_file).to be(@directory.feature_files.first)
|
48
48
|
end
|
49
49
|
|
50
50
|
it 'can get its feature' do
|
51
51
|
feature = @table.get_ancestor(:feature)
|
52
52
|
|
53
|
-
feature.
|
53
|
+
expect(feature).to be(@directory.feature_files.first.features.first)
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'can get its test' do
|
57
57
|
test = @table.get_ancestor(:test)
|
58
58
|
|
59
|
-
test.
|
59
|
+
expect(test).to be(@directory.feature_files.first.features.first.tests.first)
|
60
60
|
end
|
61
61
|
|
62
62
|
it 'can get its step' do
|
63
63
|
step = @table.get_ancestor(:step)
|
64
64
|
|
65
|
-
step.
|
65
|
+
expect(step).to be(@directory.feature_files.first.features.first.tests.first.steps.first)
|
66
66
|
end
|
67
67
|
|
68
68
|
it 'returns nil if it does not have the requested type of ancestor' do
|
69
69
|
example = @table.get_ancestor(:example)
|
70
70
|
|
71
|
-
example.
|
71
|
+
expect(example).to be_nil
|
72
72
|
end
|
73
73
|
|
74
74
|
end
|
@@ -25,43 +25,43 @@ describe 'TableRow, Integration' do
|
|
25
25
|
it 'can get its directory' do
|
26
26
|
directory = @table_row.get_ancestor(:directory)
|
27
27
|
|
28
|
-
directory.
|
28
|
+
expect(directory).to be(@directory)
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'can get its feature file' do
|
32
32
|
feature_file = @table_row.get_ancestor(:feature_file)
|
33
33
|
|
34
|
-
feature_file.
|
34
|
+
expect(feature_file).to be(@directory.feature_files.first)
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'can get its feature' do
|
38
38
|
feature = @table_row.get_ancestor(:feature)
|
39
39
|
|
40
|
-
feature.
|
40
|
+
expect(feature).to be(@directory.feature_files.first.features.first)
|
41
41
|
end
|
42
42
|
|
43
43
|
it 'can get its test' do
|
44
44
|
test = @table_row.get_ancestor(:test)
|
45
45
|
|
46
|
-
test.
|
46
|
+
expect(test).to be(@directory.feature_files.first.features.first.tests.first)
|
47
47
|
end
|
48
48
|
|
49
49
|
it 'can get its step' do
|
50
50
|
step = @table_row.get_ancestor(:step)
|
51
51
|
|
52
|
-
step.
|
52
|
+
expect(step).to be(@directory.feature_files.first.features.first.tests.first.steps.first)
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'can get its table' do
|
56
56
|
table = @table_row.get_ancestor(:table)
|
57
57
|
|
58
|
-
table.
|
58
|
+
expect(table).to be(@directory.feature_files.first.features.first.tests.first.steps.first.block)
|
59
59
|
end
|
60
60
|
|
61
61
|
it 'returns nil if it does not have the requested type of ancestor' do
|
62
62
|
example = @table_row.get_ancestor(:example)
|
63
63
|
|
64
|
-
example.
|
64
|
+
expect(example).to be_nil
|
65
65
|
end
|
66
66
|
|
67
67
|
end
|
@@ -30,37 +30,37 @@ describe 'Tag, Integration' do
|
|
30
30
|
it 'can get its directory' do
|
31
31
|
directory = @tag.get_ancestor(:directory)
|
32
32
|
|
33
|
-
directory.
|
33
|
+
expect(directory).to be(@directory)
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'can get its feature file' do
|
37
37
|
feature_file = @tag.get_ancestor(:feature_file)
|
38
38
|
|
39
|
-
feature_file.
|
39
|
+
expect(feature_file).to be(@directory.feature_files.first)
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'can get its feature' do
|
43
43
|
feature = @tag.get_ancestor(:feature)
|
44
44
|
|
45
|
-
feature.
|
45
|
+
expect(feature).to be(@directory.feature_files.first.features.first)
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'can get its test' do
|
49
49
|
test = @tag.get_ancestor(:test)
|
50
50
|
|
51
|
-
test.
|
51
|
+
expect(test).to be(@directory.feature_files.first.features.first.tests.first)
|
52
52
|
end
|
53
53
|
|
54
54
|
it 'can get its example' do
|
55
55
|
example = @tag.get_ancestor(:example)
|
56
56
|
|
57
|
-
example.
|
57
|
+
expect(example).to be(@directory.feature_files.first.features.first.tests.first.examples.first)
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'returns nil if it does not have the requested type of ancestor' do
|
61
61
|
example = @high_level_tag.get_ancestor(:example)
|
62
62
|
|
63
|
-
example.
|
63
|
+
expect(example).to be_nil
|
64
64
|
end
|
65
65
|
|
66
66
|
end
|