cucumber_analytics 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -35,7 +35,7 @@ Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?step(?: "([^"]*)
|
|
35
35
|
expected = nil
|
36
36
|
actual = @parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block
|
37
37
|
|
38
|
-
actual.
|
38
|
+
expect(actual).to eq(expected)
|
39
39
|
end
|
40
40
|
|
41
41
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? step(?: "([^"]*)")? text is "([^"]*)"$/ do |file, test, step, text|
|
@@ -87,7 +87,7 @@ Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?step(?: "([^"]*)
|
|
87
87
|
|
88
88
|
actual = @parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.class
|
89
89
|
|
90
|
-
actual.
|
90
|
+
expect(actual).to eq(expected)
|
91
91
|
end
|
92
92
|
|
93
93
|
Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?step(?: "([^"]*)")? source line is "([^"]*)"$/ do |file, test, step, line_number|
|
@@ -98,7 +98,7 @@ Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?step(?: "([^"]*)
|
|
98
98
|
expected = line_number.to_i
|
99
99
|
actual = @parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].source_line
|
100
100
|
|
101
|
-
actual.
|
101
|
+
expect(actual).to eq(expected)
|
102
102
|
end
|
103
103
|
|
104
104
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? step(?: "([^"]*)")? correctly stores its underlying implementation$/ do |file, test, step|
|
@@ -108,7 +108,7 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? step(?: "([^"]*)")? c
|
|
108
108
|
|
109
109
|
raw_element = @parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].raw_element
|
110
110
|
|
111
|
-
raw_element.
|
111
|
+
expect(raw_element).to have_key('keyword')
|
112
112
|
end
|
113
113
|
|
114
114
|
Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?step(?: "([^"]*)")? table row(?: "([^"]*)")? is found to have the following properties:$/ do |file, test, step, row, properties|
|
@@ -135,7 +135,7 @@ Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?step(?: "([^"]*)
|
|
135
135
|
|
136
136
|
raw_element = @parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.row_elements[row - 1].raw_element
|
137
137
|
|
138
|
-
raw_element.
|
138
|
+
expect(raw_element).to have_key('cells')
|
139
139
|
end
|
140
140
|
|
141
141
|
Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?step(?: "([^"]*)")? table row(?: "([^"]*)")? cells are as follows:$/ do |file, test, step, row, cells|
|
@@ -155,5 +155,5 @@ Given(/^a step element based on the following gherkin:$/) do |step_text|
|
|
155
155
|
end
|
156
156
|
|
157
157
|
Then(/^the step has convenient output$/) do
|
158
|
-
@parsed_files.first.feature.tests.first.steps.first.method(:to_s).owner.
|
158
|
+
expect(@parsed_files.first.feature.tests.first.steps.first.method(:to_s).owner).to eq(CucumberAnalytics::Step)
|
159
159
|
end
|
@@ -5,9 +5,9 @@ Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?(?:step(?: "([^"
|
|
5
5
|
|
6
6
|
expected = contents.raw
|
7
7
|
|
8
|
-
@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.row_elements.collect { |row| row.cells }.
|
8
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.row_elements.collect { |row| row.cells }).to eq(expected)
|
9
9
|
# todo - remove once #contents is no longer supported
|
10
|
-
@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.contents.
|
10
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.contents).to eq(expected)
|
11
11
|
end
|
12
12
|
|
13
13
|
Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?(?:step(?: "([^"]*)") )?table correctly stores its underlying implementation$/ do |file, test, step|
|
@@ -17,8 +17,8 @@ Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?(?:step(?: "([^"
|
|
17
17
|
|
18
18
|
raw_element = @parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.raw_element
|
19
19
|
|
20
|
-
raw_element.
|
21
|
-
raw_element.each { |row| row.
|
20
|
+
expect(raw_element).to be_a(Array)
|
21
|
+
raw_element.each { |row| expect(row).to have_key('cells') }
|
22
22
|
end
|
23
23
|
|
24
24
|
Given(/^a table row element$/) do
|
@@ -34,7 +34,7 @@ Given(/^a table row element based on the following gherkin:$/) do |row_text|
|
|
34
34
|
end
|
35
35
|
|
36
36
|
Then(/^the table row has convenient output$/) do
|
37
|
-
@parsed_files.first.feature.tests.first.steps.first.block.row_elements.first.method(:to_s).owner.
|
37
|
+
expect(@parsed_files.first.feature.tests.first.steps.first.block.row_elements.first.method(:to_s).owner).to eq(CucumberAnalytics::TableRow)
|
38
38
|
end
|
39
39
|
|
40
40
|
Given(/^a table element$/) do
|
@@ -46,7 +46,7 @@ When(/^the table element has no rows$/) do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
Then(/^the table has convenient output$/) do
|
49
|
-
@parsed_files.first.feature.tests.first.steps.first.block.method(:to_s).owner.
|
49
|
+
expect(@parsed_files.first.feature.tests.first.steps.first.block.method(:to_s).owner).to eq(CucumberAnalytics::Table)
|
50
50
|
end
|
51
51
|
|
52
52
|
Given(/^a table element based on the following gherkin:$/) do |table_text|
|
@@ -1,59 +1,59 @@
|
|
1
1
|
Then /^the feature tag correctly stores its underlying implementation$/ do
|
2
2
|
raw_element = @parsed_files.first.feature.tag_elements.first.raw_element
|
3
3
|
|
4
|
-
raw_element.
|
4
|
+
expect(raw_element).to have_key('name')
|
5
5
|
end
|
6
6
|
|
7
7
|
When(/^the test tag correctly stores its underlying implementation$/) do
|
8
8
|
raw_element = @parsed_files.first.feature.tests.first.tag_elements.first.raw_element
|
9
9
|
|
10
|
-
raw_element.
|
10
|
+
expect(raw_element).to have_key('name')
|
11
11
|
end
|
12
12
|
|
13
13
|
When(/^the example tag correctly stores its underlying implementation$/) do
|
14
14
|
raw_element = @parsed_files.first.feature.tests.first.examples.first.tag_elements.first.raw_element
|
15
15
|
|
16
|
-
raw_element.
|
16
|
+
expect(raw_element).to have_key('name')
|
17
17
|
end
|
18
18
|
|
19
19
|
Then(/^the feature tag name is "([^"]*)"$/) do |tag_name|
|
20
20
|
tag = @parsed_files.first.feature.tag_elements.first
|
21
21
|
|
22
|
-
tag.name.
|
22
|
+
expect(tag.name).to eq(tag_name)
|
23
23
|
end
|
24
24
|
|
25
25
|
When(/^the test tag name is "([^"]*)"$/) do |tag_name|
|
26
26
|
tag = @parsed_files.first.feature.tests.first.tag_elements.first
|
27
27
|
|
28
|
-
tag.name.
|
28
|
+
expect(tag.name).to eq(tag_name)
|
29
29
|
end
|
30
30
|
|
31
31
|
When(/^the example tag name is "([^"]*)"$/) do |tag_name|
|
32
32
|
tag = @parsed_files.first.feature.tests.first.examples.first.tag_elements.first
|
33
33
|
|
34
|
-
tag.name.
|
34
|
+
expect(tag.name).to eq(tag_name)
|
35
35
|
end
|
36
36
|
|
37
37
|
Then(/^the feature tag source line "([^"]*)"$/) do |line|
|
38
38
|
tag = @parsed_files.first.feature.tag_elements.first
|
39
39
|
|
40
|
-
tag.source_line.
|
40
|
+
expect(tag.source_line).to eq(line)
|
41
41
|
end
|
42
42
|
|
43
43
|
When(/^the test tag source line "([^"]*)"$/) do |line|
|
44
44
|
tag = @parsed_files.first.feature.tests.first.tag_elements.first
|
45
45
|
|
46
|
-
tag.source_line.
|
46
|
+
expect(tag.source_line).to eq(line)
|
47
47
|
end
|
48
48
|
|
49
49
|
When(/^the example tag source line "([^"]*)"$/) do |line|
|
50
50
|
tag = @parsed_files.first.feature.tests.first.examples.first.tag_elements.first
|
51
51
|
|
52
|
-
tag.source_line.
|
52
|
+
expect(tag.source_line).to eq(line)
|
53
53
|
end
|
54
54
|
|
55
55
|
Then(/^the tag has convenient output$/) do
|
56
|
-
@parsed_files.first.feature.tag_elements.first.method(:to_s).owner.
|
56
|
+
expect(@parsed_files.first.feature.tag_elements.first.method(:to_s).owner).to eq(CucumberAnalytics::Tag)
|
57
57
|
end
|
58
58
|
|
59
59
|
Given(/^a tag element based on the following gherkin:$/) do |tag_text|
|
@@ -16,8 +16,8 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? has the following des
|
|
16
16
|
new_description = @parsed_files[file - 1].feature.tests[test - 1].description_text
|
17
17
|
old_description = @parsed_files[file - 1].feature.tests[test - 1].description
|
18
18
|
|
19
|
-
new_description.
|
20
|
-
old_description.
|
19
|
+
expect(new_description).to eq(text)
|
20
|
+
expect(old_description).to eq(remove_whitespace(text))
|
21
21
|
end
|
22
22
|
|
23
23
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? steps are as follows:$/ do |file, test, steps|
|
@@ -47,8 +47,8 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? is found to have the
|
|
47
47
|
|
48
48
|
expected_tags = expected_tags.raw.flatten
|
49
49
|
|
50
|
-
@parsed_files[file - 1].feature.tests[test - 1].tags.
|
51
|
-
@parsed_files[file - 1].feature.tests[test - 1].tag_elements.collect { |tag| tag.name }.
|
50
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].tags).to eq(expected_tags)
|
51
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].tag_elements.collect { |tag| tag.name }).to eq(expected_tags)
|
52
52
|
end
|
53
53
|
|
54
54
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? is found to have the following applied tags:$/ do |file, test, expected_tags|
|
@@ -57,8 +57,8 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? is found to have the
|
|
57
57
|
|
58
58
|
expected_tags = expected_tags.raw.flatten
|
59
59
|
|
60
|
-
@parsed_files[file - 1].feature.tests[test - 1].applied_tags.
|
61
|
-
@parsed_files[file - 1].feature.tests[test - 1].applied_tag_elements.collect { |tag| tag.name }.
|
60
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].applied_tags).to eq(expected_tags)
|
61
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].applied_tag_elements.collect { |tag| tag.name }).to eq(expected_tags)
|
62
62
|
end
|
63
63
|
|
64
64
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? step "([^"]*)" has the following block:$/ do |file, test, step, block|
|
@@ -102,11 +102,11 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? correctly stores its
|
|
102
102
|
expected = ['Scenario', 'Scenario Outline']
|
103
103
|
actual = raw_element['keyword']
|
104
104
|
|
105
|
-
expected.include
|
105
|
+
expect(expected).to include(actual)
|
106
106
|
end
|
107
107
|
|
108
108
|
Then(/^the scenario has convenient output$/) do
|
109
|
-
@parsed_files.first.feature.tests.first.method(:to_s).owner.
|
109
|
+
expect(@parsed_files.first.feature.tests.first.method(:to_s).owner).to eq(CucumberAnalytics::Scenario)
|
110
110
|
end
|
111
111
|
|
112
112
|
Given(/^a scenario element based on the following gherkin:$/) do |scenario_text|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Then(/^the following text is provided:$/) do |expected_text|
|
2
2
|
expected_text.sub!('path_to', @default_file_directory)
|
3
3
|
|
4
|
-
@output.
|
4
|
+
expect(@output).to eq(expected_text)
|
5
5
|
end
|
6
6
|
|
7
7
|
Then(/^the text provided is "(.*)"$/) do |text_string|
|
8
|
-
@output.
|
8
|
+
expect(@output).to eq(text_string.gsub('\n', "\n"))
|
9
9
|
end
|
@@ -2,31 +2,31 @@ Then /^the tags collected from (?:feature "([^"]*)" )?test "([^"]*)" are as foll
|
|
2
2
|
file ||= 1
|
3
3
|
expected_tags = expected_tags.raw.flatten
|
4
4
|
|
5
|
-
CucumberAnalytics::World.tags_in(@parsed_files[file - 1].feature.tests[test - 1]).sort.
|
6
|
-
CucumberAnalytics::World.tag_elements_in(@parsed_files[file - 1].feature.tests[test - 1]).collect { |tag| tag.name }.sort.
|
5
|
+
expect(CucumberAnalytics::World.tags_in(@parsed_files[file - 1].feature.tests[test - 1]).sort).to eq(expected_tags.sort)
|
6
|
+
expect(CucumberAnalytics::World.tag_elements_in(@parsed_files[file - 1].feature.tests[test - 1]).collect { |tag| tag.name }.sort).to eq(expected_tags.sort)
|
7
7
|
end
|
8
8
|
|
9
9
|
Then /^the tags collected from feature "([^"]*)" are as follows:$/ do |file, expected_tags|
|
10
10
|
file ||= 1
|
11
11
|
expected_tags = expected_tags.raw.flatten
|
12
12
|
|
13
|
-
CucumberAnalytics::World.tags_in(@parsed_files[file - 1].feature).sort
|
14
|
-
CucumberAnalytics::World.tag_elements_in(@parsed_files[file - 1].feature).collect { |tag| tag.name }.sort.
|
13
|
+
expect(CucumberAnalytics::World.tags_in(@parsed_files[file - 1].feature).sort).to eq(expected_tags.sort)
|
14
|
+
expect(CucumberAnalytics::World.tag_elements_in(@parsed_files[file - 1].feature).collect { |tag| tag.name }.sort).to eq(expected_tags.sort)
|
15
15
|
end
|
16
16
|
|
17
17
|
Then /^the tags collected from file "([^"]*)" are as follows:$/ do |file, expected_tags|
|
18
18
|
file ||= 1
|
19
19
|
expected_tags = expected_tags.raw.flatten
|
20
20
|
|
21
|
-
CucumberAnalytics::World.tags_in(@parsed_files[file - 1]).sort.
|
22
|
-
CucumberAnalytics::World.tag_elements_in(@parsed_files[file - 1]).collect { |tag| tag.name }.sort.
|
21
|
+
expect(CucumberAnalytics::World.tags_in(@parsed_files[file - 1]).sort).to eq(expected_tags.sort)
|
22
|
+
expect(CucumberAnalytics::World.tag_elements_in(@parsed_files[file - 1]).collect { |tag| tag.name }.sort).to eq(expected_tags.sort)
|
23
23
|
end
|
24
24
|
|
25
25
|
Then /^the tags collected from directory are as follows:$/ do |expected_tags|
|
26
26
|
expected_tags = expected_tags.raw.flatten
|
27
27
|
|
28
|
-
CucumberAnalytics::World.tags_in(@parsed_directories.last).sort.
|
29
|
-
CucumberAnalytics::World.tag_elements_in(@parsed_directories.last).collect { |tag| tag.name }.sort.
|
28
|
+
expect(CucumberAnalytics::World.tags_in(@parsed_directories.last).sort).to eq(expected_tags.sort)
|
29
|
+
expect(CucumberAnalytics::World.tag_elements_in(@parsed_directories.last).collect { |tag| tag.name }.sort).to eq(expected_tags.sort)
|
30
30
|
end
|
31
31
|
|
32
32
|
Then /^the(?: "([^"]*)")? steps collected from feature "([^"]*)" background are as follows:$/ do |defined, file, steps|
|
@@ -67,6 +67,8 @@ module CucumberAnalytics
|
|
67
67
|
# Returns true if the two steps have the same text, minus any keywords
|
68
68
|
# and arguments, and false otherwise.
|
69
69
|
def ==(other_step)
|
70
|
+
return false unless other_step.respond_to?(:step_text)
|
71
|
+
|
70
72
|
left_step = step_text(:with_keywords => false, :with_arguments => false)
|
71
73
|
right_step = other_step.step_text(:with_keywords => false, :with_arguments => false)
|
72
74
|
|
@@ -79,7 +81,7 @@ module CucumberAnalytics
|
|
79
81
|
# exclude certain portions of the text. *left_delimiter* and *right_delimiter*
|
80
82
|
# are used to determine which parts of the step are arguments.
|
81
83
|
#
|
82
|
-
# a_step = CucumberAnalytics.new("Given *some* step with a block:\n|block line 1|\n|block line 2|")
|
84
|
+
# a_step = CucumberAnalytics::Step.new("Given *some* step with a block:\n|block line 1|\n|block line 2|")
|
83
85
|
#
|
84
86
|
# a_step.step_text
|
85
87
|
# #=> ['Given *some* step with a block:', '|block line 1|', '|block line 2|']
|
@@ -12,7 +12,7 @@ describe 'Background, Integration' do
|
|
12
12
|
background = CucumberAnalytics::Background.new(source)
|
13
13
|
step = background.steps.first
|
14
14
|
|
15
|
-
step.parent_element.
|
15
|
+
expect(step.parent_element).to be(background)
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'getting stuff' do
|
@@ -35,25 +35,25 @@ describe 'Background, Integration' do
|
|
35
35
|
it 'can get its directory' do
|
36
36
|
directory = @background.get_ancestor(:directory)
|
37
37
|
|
38
|
-
directory.
|
38
|
+
expect(directory).to be(@directory)
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'can get its feature file' do
|
42
42
|
feature_file = @background.get_ancestor(:feature_file)
|
43
43
|
|
44
|
-
feature_file.
|
44
|
+
expect(feature_file).to be(@directory.feature_files.first)
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'can get its feature' do
|
48
48
|
feature = @background.get_ancestor(:feature)
|
49
49
|
|
50
|
-
feature.
|
50
|
+
expect(feature).to be(@directory.feature_files.first.features.first)
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'returns nil if it does not have the requested type of ancestor' do
|
54
54
|
example = @background.get_ancestor(:example)
|
55
55
|
|
56
|
-
example.
|
56
|
+
expect(example).to be_nil
|
57
57
|
end
|
58
58
|
|
59
59
|
end
|
@@ -17,8 +17,8 @@ describe 'Directory, Integration' do
|
|
17
17
|
nested_directory = directory.directories.first
|
18
18
|
file = directory.feature_files.first
|
19
19
|
|
20
|
-
nested_directory.parent_element.
|
21
|
-
file.parent_element.
|
20
|
+
expect(nested_directory.parent_element).to be(directory)
|
21
|
+
expect(file.parent_element).to be(directory)
|
22
22
|
end
|
23
23
|
|
24
24
|
context 'getting stuff' do
|
@@ -35,13 +35,13 @@ describe 'Directory, Integration' do
|
|
35
35
|
it 'can get its directory' do
|
36
36
|
directory = @nested_directory.get_ancestor(:directory)
|
37
37
|
|
38
|
-
directory.
|
38
|
+
expect(directory).to be(@directory)
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'returns nil if it does not have the requested type of ancestor' do
|
42
42
|
example = @nested_directory.get_ancestor(:example)
|
43
43
|
|
44
|
-
example.
|
44
|
+
expect(example).to be_nil
|
45
45
|
end
|
46
46
|
|
47
47
|
end
|
@@ -29,37 +29,37 @@ describe 'DocString, Integration' do
|
|
29
29
|
it 'can get its directory' do
|
30
30
|
directory = @doc_string.get_ancestor(:directory)
|
31
31
|
|
32
|
-
directory.
|
32
|
+
expect(directory).to be(@directory)
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'can get its feature file' do
|
36
36
|
feature_file = @doc_string.get_ancestor(:feature_file)
|
37
37
|
|
38
|
-
feature_file.
|
38
|
+
expect(feature_file).to be(@directory.feature_files.first)
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'can get its feature' do
|
42
42
|
feature = @doc_string.get_ancestor(:feature)
|
43
43
|
|
44
|
-
feature.
|
44
|
+
expect(feature).to be(@directory.feature_files.first.features.first)
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'can get its test' do
|
48
48
|
test = @doc_string.get_ancestor(:test)
|
49
49
|
|
50
|
-
test.
|
50
|
+
expect(test).to be(@directory.feature_files.first.features.first.tests.first)
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'can get its step' do
|
54
54
|
step = @doc_string.get_ancestor(:step)
|
55
55
|
|
56
|
-
step.
|
56
|
+
expect(step).to be(@directory.feature_files.first.features.first.tests.first.steps.first)
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'returns nil if it does not have the requested type of ancestor' do
|
60
60
|
example = @doc_string.get_ancestor(:example)
|
61
61
|
|
62
|
-
example.
|
62
|
+
expect(example).to be_nil
|
63
63
|
end
|
64
64
|
|
65
65
|
end
|
@@ -15,9 +15,9 @@ describe 'Example, Integration' do
|
|
15
15
|
rows = example.row_elements
|
16
16
|
tag = example.tag_elements.first
|
17
17
|
|
18
|
-
rows[0].parent_element.
|
19
|
-
rows[1].parent_element.
|
20
|
-
tag.parent_element.
|
18
|
+
expect(rows[0].parent_element).to be(example)
|
19
|
+
expect(rows[1].parent_element).to be(example)
|
20
|
+
expect(tag.parent_element).to be(example)
|
21
21
|
end
|
22
22
|
|
23
23
|
context 'getting stuff' do
|
@@ -42,31 +42,31 @@ describe 'Example, Integration' do
|
|
42
42
|
it 'can get its directory' do
|
43
43
|
directory = @example.get_ancestor(:directory)
|
44
44
|
|
45
|
-
directory.
|
45
|
+
expect(directory).to be(@directory)
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'can get its feature file' do
|
49
49
|
feature_file = @example.get_ancestor(:feature_file)
|
50
50
|
|
51
|
-
feature_file.
|
51
|
+
expect(feature_file).to be(@directory.feature_files.first)
|
52
52
|
end
|
53
53
|
|
54
54
|
it 'can get its feature' do
|
55
55
|
feature = @example.get_ancestor(:feature)
|
56
56
|
|
57
|
-
feature.
|
57
|
+
expect(feature).to be(@directory.feature_files.first.features.first)
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'can get its test' do
|
61
61
|
test = @example.get_ancestor(:test)
|
62
62
|
|
63
|
-
test.
|
63
|
+
expect(test).to be(@directory.feature_files.first.features.first.tests.first)
|
64
64
|
end
|
65
65
|
|
66
66
|
it 'returns nil if it does not have the requested type of ancestor' do
|
67
67
|
example = @example.get_ancestor(:example)
|
68
68
|
|
69
|
-
example.
|
69
|
+
expect(example).to be_nil
|
70
70
|
end
|
71
71
|
|
72
72
|
end
|