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
data/History.rdoc
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== Version 1.5.2 / 2016-01-21
|
2
|
+
|
3
|
+
* Bug fix: Fixed an error caused by comparing elements with step objects to
|
4
|
+
anything that did not have step objects.
|
5
|
+
|
6
|
+
|
1
7
|
=== Version 1.5.1 / 2014-05-26
|
2
8
|
|
3
9
|
* Version ranges have been removed for the gherkin gem. Since this gem can work
|
data/Rakefile
CHANGED
@@ -1,39 +1,22 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
2
|
require "bundler/gem_tasks"
|
3
|
-
require '
|
4
|
-
require 'rspec/core/rake_task'
|
3
|
+
require 'racatt'
|
5
4
|
|
5
|
+
namespace 'cucumber_analytics' do
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
def combine_options(set_1, set_2)
|
12
|
-
set_2 ? "#{set_1} #{set_2}" : set_1
|
13
|
-
end
|
7
|
+
task :clear_coverage do
|
8
|
+
code_coverage_directory = "#{File.dirname(__FILE__)}/coverage"
|
14
9
|
|
10
|
+
FileUtils.remove_dir(code_coverage_directory, true)
|
11
|
+
end
|
15
12
|
|
16
|
-
task :clear_coverage do
|
17
|
-
code_coverage_directory = "#{File.dirname(__FILE__)}/coverage"
|
18
13
|
|
19
|
-
|
20
|
-
end
|
14
|
+
Racatt.create_tasks
|
21
15
|
|
22
|
-
|
23
|
-
task :
|
24
|
-
set_cucumber_options(combine_options("-t ~@wip -t ~@off -f progress", args[:options]))
|
25
|
-
end
|
26
|
-
Cucumber::Rake::Task.new(:tests)
|
16
|
+
# Redefining the task from 'racatt' in order to clear the code coverage results
|
17
|
+
task :test_everything, [:command_options] => :clear_coverage
|
27
18
|
|
28
|
-
desc 'Run all API specifications for the gem'
|
29
|
-
RSpec::Core::RakeTask.new(:specs) do |t|
|
30
|
-
t.rspec_opts = "-t ~wip -t ~off"
|
31
19
|
end
|
32
20
|
|
33
|
-
desc 'Run All The Things'
|
34
|
-
task :everything => :clear_coverage do
|
35
|
-
Rake::Task[:specs].invoke
|
36
|
-
Rake::Task[:tests].invoke('-t ~@redundant')
|
37
|
-
end
|
38
21
|
|
39
|
-
task :default => :
|
22
|
+
task :default => 'cucumber_analytics:test_everything'
|
data/cucumber_analytics.gemspec
CHANGED
@@ -62,14 +62,3 @@ Feature: Background elements can be modeled.
|
|
62
62
|
|
63
63
|
Scenario: Convenient output of a background
|
64
64
|
Then the background has convenient output
|
65
|
-
|
66
|
-
@redundant
|
67
|
-
Scenario Outline: Background models pass all other specifications
|
68
|
-
Exact specifications detailing the API for background models.
|
69
|
-
Given that there are "<additional specifications>" detailing models
|
70
|
-
When the corresponding specifications are run
|
71
|
-
Then all of those specifications are met
|
72
|
-
Examples:
|
73
|
-
| additional specifications |
|
74
|
-
| background_unit_spec.rb |
|
75
|
-
| background_integration_spec.rb |
|
@@ -107,14 +107,3 @@ Feature: Directories can be modeled.
|
|
107
107
|
|
108
108
|
Scenario: Convenient output of a directory
|
109
109
|
Then the directory has convenient output
|
110
|
-
|
111
|
-
@redundant
|
112
|
-
Scenario Outline: Directory models pass all other specifications
|
113
|
-
Exact specifications detailing the API for directory models.
|
114
|
-
Given that there are "<additional specifications>" detailing models
|
115
|
-
When the corresponding specifications are run
|
116
|
-
Then all of those specifications are met
|
117
|
-
Examples:
|
118
|
-
| additional specifications |
|
119
|
-
| directory_unit_spec.rb |
|
120
|
-
| directory_integration_spec.rb |
|
@@ -50,14 +50,3 @@ Feature: Doc string elements can be modeled.
|
|
50
50
|
|
51
51
|
Scenario: Convenient output of an a doc string
|
52
52
|
Then the doc string has convenient output
|
53
|
-
|
54
|
-
@redundant
|
55
|
-
Scenario Outline: Doc string models pass all other specifications
|
56
|
-
Exact specifications detailing the API for doc string models.
|
57
|
-
Given that there are "<additional specifications>" detailing models
|
58
|
-
When the corresponding specifications are run
|
59
|
-
Then all of those specifications are met
|
60
|
-
Examples:
|
61
|
-
| additional specifications |
|
62
|
-
| doc_string_unit_spec.rb |
|
63
|
-
| doc_string_integration_spec.rb |
|
@@ -98,14 +98,3 @@ Feature: Example elements can be modeled.
|
|
98
98
|
|
99
99
|
Scenario: Convenient output of an example block
|
100
100
|
Then the example block has convenient output
|
101
|
-
|
102
|
-
@redundant
|
103
|
-
Scenario Outline: Example models pass all other specifications
|
104
|
-
Exact specifications detailing the API for example block models.
|
105
|
-
Given that there are "<additional specifications>" detailing models
|
106
|
-
When the corresponding specifications are run
|
107
|
-
Then all of those specifications are met
|
108
|
-
Examples:
|
109
|
-
| additional specifications |
|
110
|
-
| example_unit_spec.rb |
|
111
|
-
| example_integration_spec.rb |
|
@@ -51,14 +51,3 @@ Feature: Feature files can be modeled.
|
|
51
51
|
|
52
52
|
Scenario: Convenient output of a feature file
|
53
53
|
Then the feature file has convenient output
|
54
|
-
|
55
|
-
@redundant
|
56
|
-
Scenario Outline: Feature file models pass all other specifications
|
57
|
-
Exact specifications detailing the API for .feature file models.
|
58
|
-
Given that there are "<additional specifications>" detailing models
|
59
|
-
When the corresponding specifications are run
|
60
|
-
Then all of those specifications are met
|
61
|
-
Examples:
|
62
|
-
| additional specifications |
|
63
|
-
| feature_file_unit_spec.rb |
|
64
|
-
| feature_file_integration_spec.rb |
|
@@ -151,14 +151,3 @@ Feature: Features can be modeled.
|
|
151
151
|
|
152
152
|
Scenario: Convenient output of a feature
|
153
153
|
Then the feature has convenient output
|
154
|
-
|
155
|
-
@redundant
|
156
|
-
Scenario Outline: Feature models pass all other specifications
|
157
|
-
Exact specifications detailing the API for feature models.
|
158
|
-
Given that there are "<additional specifications>" detailing models
|
159
|
-
When the corresponding specifications are run
|
160
|
-
Then all of those specifications are met
|
161
|
-
Examples:
|
162
|
-
| additional specifications |
|
163
|
-
| feature_unit_spec.rb |
|
164
|
-
| feature_integration_spec.rb |
|
@@ -87,14 +87,3 @@ Feature: Outline elements can be modeled.
|
|
87
87
|
|
88
88
|
Scenario: Convenient output of an an outline
|
89
89
|
Then the outline has convenient output
|
90
|
-
|
91
|
-
@redundant
|
92
|
-
Scenario Outline: Outline models pass all other specifications
|
93
|
-
Exact specifications detailing the API for outline models.
|
94
|
-
Given that there are "<additional specifications>" detailing models
|
95
|
-
When the corresponding specifications are run
|
96
|
-
Then all of those specifications are met
|
97
|
-
Examples:
|
98
|
-
| additional specifications |
|
99
|
-
| outline_unit_spec.rb |
|
100
|
-
| outline_integration_spec.rb |
|
@@ -65,13 +65,3 @@ Feature: Row elements can be modeled.
|
|
65
65
|
|
66
66
|
Scenario: Convenient output of a row
|
67
67
|
Then the row has convenient output
|
68
|
-
|
69
|
-
@redundant
|
70
|
-
Scenario Outline: Row models pass all other specifications
|
71
|
-
Exact specifications detailing the API for Row models.
|
72
|
-
Given that there are "<additional specifications>" detailing models
|
73
|
-
When the corresponding specifications are run
|
74
|
-
Then all of those specifications are met
|
75
|
-
Examples:
|
76
|
-
| additional specifications |
|
77
|
-
| row_unit_spec.rb |
|
@@ -76,14 +76,3 @@ Feature: Scenario elements can be modeled.
|
|
76
76
|
|
77
77
|
Scenario: Convenient output of a scenario
|
78
78
|
Then the scenario has convenient output
|
79
|
-
|
80
|
-
@redundant
|
81
|
-
Scenario Outline: Scenario models pass all other specifications
|
82
|
-
Exact specifications detailing the API for scenario models.
|
83
|
-
Given that there are "<additional specifications>" detailing models
|
84
|
-
When the corresponding specifications are run
|
85
|
-
Then all of those specifications are met
|
86
|
-
Examples:
|
87
|
-
| additional specifications |
|
88
|
-
| scenario_unit_spec.rb |
|
89
|
-
| scenario_integration_spec.rb |
|
@@ -72,14 +72,3 @@ Feature: Step elements can be modeled.
|
|
72
72
|
|
73
73
|
Scenario: Convenient output of a step
|
74
74
|
Then the step has convenient output
|
75
|
-
|
76
|
-
@redundant
|
77
|
-
Scenario Outline: Step models pass all other specifications
|
78
|
-
Exact specifications detailing the API for step models.
|
79
|
-
Given that there are "<additional specifications>" detailing models
|
80
|
-
When the corresponding specifications are run
|
81
|
-
Then all of those specifications are met
|
82
|
-
Examples:
|
83
|
-
| additional specifications |
|
84
|
-
| step_unit_spec.rb |
|
85
|
-
| step_integration_spec.rb |
|
@@ -39,14 +39,3 @@ Feature: Table elements can be modeled.
|
|
39
39
|
|
40
40
|
Scenario: Convenient output of a table
|
41
41
|
Then the table has convenient output
|
42
|
-
|
43
|
-
@redundant
|
44
|
-
Scenario Outline: Table models pass all other specifications
|
45
|
-
Exact specifications detailing the API for table models.
|
46
|
-
Given that there are "<additional specifications>" detailing models
|
47
|
-
When the corresponding specifications are run
|
48
|
-
Then all of those specifications are met
|
49
|
-
Examples:
|
50
|
-
| additional specifications |
|
51
|
-
| table_unit_spec.rb |
|
52
|
-
| table_integration_spec.rb |
|
@@ -54,14 +54,3 @@ Feature: Table Row elements can be modeled.
|
|
54
54
|
|
55
55
|
Scenario: Convenient output of a table row
|
56
56
|
Then the table row has convenient output
|
57
|
-
|
58
|
-
@redundant
|
59
|
-
Scenario Outline: Table row models pass all other specifications
|
60
|
-
Exact specifications detailing the API for table table row models.
|
61
|
-
Given that there are "<additional specifications>" detailing models
|
62
|
-
When the corresponding specifications are run
|
63
|
-
Then all of those specifications are met
|
64
|
-
Examples:
|
65
|
-
| additional specifications |
|
66
|
-
| table_row_unit_spec.rb |
|
67
|
-
| table_row_integration_spec.rb |
|
@@ -45,14 +45,3 @@ Feature: Tag elements can be modeled.
|
|
45
45
|
|
46
46
|
Scenario: Convenient output of a tag
|
47
47
|
Then the tag has convenient output
|
48
|
-
|
49
|
-
@redundant
|
50
|
-
Scenario Outline: Tag models pass all other specifications
|
51
|
-
Exact specifications detailing the API for tag models.
|
52
|
-
Given that there are "<additional specifications>" detailing models
|
53
|
-
When the corresponding specifications are run
|
54
|
-
Then all of those specifications are met
|
55
|
-
Examples:
|
56
|
-
| additional specifications |
|
57
|
-
| tag_unit_spec.rb |
|
58
|
-
| tag_integration_spec.rb |
|
@@ -6,7 +6,7 @@ Then /^the(?: feature "([^"]*)")? background is found to have the following prop
|
|
6
6
|
expected = expected_value
|
7
7
|
actual = @parsed_files[file - 1].feature.background.send(property.to_sym).to_s
|
8
8
|
|
9
|
-
actual.
|
9
|
+
expect(actual).to eq(expected)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -18,8 +18,8 @@ Then /^the(?: feature "([^"]*)")? background has the following description:/ do
|
|
18
18
|
new_description = @parsed_files[file - 1].feature.background.description_text
|
19
19
|
old_description = @parsed_files[file - 1].feature.background.description
|
20
20
|
|
21
|
-
new_description.
|
22
|
-
old_description.
|
21
|
+
expect(new_description).to eq(expected)
|
22
|
+
expect(old_description).to eq(remove_whitespace(expected))
|
23
23
|
end
|
24
24
|
|
25
25
|
Then /^the(?: feature "([^"]*)")? background's steps are as follows:$/ do |file, steps|
|
@@ -76,6 +76,6 @@ Given(/^a background element based on the following gherkin:$/) do |background_t
|
|
76
76
|
end
|
77
77
|
|
78
78
|
Then /^the background has convenient output$/ do
|
79
|
-
@parsed_files.first.feature.background.method(:to_s).owner.
|
79
|
+
expect(@parsed_files.first.feature.background.method(:to_s).owner).to eq(CucumberAnalytics::Background)
|
80
80
|
end
|
81
81
|
|
@@ -48,5 +48,5 @@ Given(/^a directory element based on "([^"]*)"$/) do |directory_name|
|
|
48
48
|
end
|
49
49
|
|
50
50
|
Then(/^the directory has convenient output$/) do
|
51
|
-
@parsed_directories.first.method(:to_s).owner.
|
51
|
+
expect(@parsed_directories.first.method(:to_s).owner).to eq(CucumberAnalytics::Directory)
|
52
52
|
end
|
@@ -25,9 +25,9 @@ Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?(?:step(?: "([^"
|
|
25
25
|
test ||= 1
|
26
26
|
step ||= 1
|
27
27
|
|
28
|
-
@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.contents_text.
|
28
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.contents_text).to eq(contents)
|
29
29
|
# Remove once Array contents is no longer supported
|
30
|
-
@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.contents.
|
30
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.contents).to eq(contents.split("\n", -1))
|
31
31
|
end
|
32
32
|
|
33
33
|
Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?(?:step(?: "([^"]*)") )?doc string contents are empty$/ do |file, test, step|
|
@@ -36,8 +36,8 @@ Then /^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?(?:step(?: "([^"
|
|
36
36
|
step ||= 1
|
37
37
|
|
38
38
|
#todo Remove once Array contents is no longer supported
|
39
|
-
@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.contents.
|
40
|
-
@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.contents_text.
|
39
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.contents).to be_empty
|
40
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.contents_text).to be_empty
|
41
41
|
end
|
42
42
|
|
43
43
|
Then(/^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?(?:step(?: "([^"]*)") )?doc string correctly stores its underlying implementation$/) do |file, test, step|
|
@@ -47,11 +47,11 @@ Then(/^(?:the )?(?:feature "([^"]*)" )?(?:test(?: "([^"]*)")? )?(?:step(?: "([^"
|
|
47
47
|
|
48
48
|
raw_element = @parsed_files[file - 1].feature.tests[test - 1].steps[step - 1].block.raw_element
|
49
49
|
|
50
|
-
raw_element.
|
50
|
+
expect(raw_element).to have_key('content_type')
|
51
51
|
end
|
52
52
|
|
53
53
|
Then(/^the doc string has convenient output$/) do
|
54
|
-
@parsed_files.first.feature.tests.first.steps.first.block.method(:to_s).owner.
|
54
|
+
expect(@parsed_files.first.feature.tests.first.steps.first.block.method(:to_s).owner).to eq(CucumberAnalytics::DocString)
|
55
55
|
end
|
56
56
|
|
57
57
|
Given(/^a doc string element based on the following gherkin:$/) do |doc_string_text|
|
@@ -30,7 +30,7 @@ When /^(?:the )?file(?: "([^"]*)")? has no features$/ do |file|
|
|
30
30
|
end
|
31
31
|
|
32
32
|
Then(/^the feature file has convenient output$/) do
|
33
|
-
@parsed_files.first.method(:to_s).owner.
|
33
|
+
expect(@parsed_files.first.method(:to_s).owner).to eq(CucumberAnalytics::FeatureFile)
|
34
34
|
end
|
35
35
|
|
36
36
|
Given(/^a feature file element based on "([^"]*)"$/) do |file_name|
|
@@ -14,20 +14,20 @@ Then /^(?:the )?feature "([^"]*)" has the following description:$/ do |file, tex
|
|
14
14
|
new_description = @parsed_files[file - 1].feature.description_text
|
15
15
|
old_description = @parsed_files[file - 1].feature.description
|
16
16
|
|
17
|
-
new_description.
|
18
|
-
old_description.
|
17
|
+
expect(new_description).to eq(text)
|
18
|
+
expect(old_description).to eq(remove_whitespace(text))
|
19
19
|
end
|
20
20
|
|
21
21
|
Then /^feature "([^"]*)" is found to have the following tags:$/ do |file, expected_tags|
|
22
22
|
expected_tags = expected_tags.raw.flatten
|
23
23
|
|
24
|
-
@parsed_files[file - 1].feature.tags.
|
25
|
-
@parsed_files[file - 1].feature.tag_elements.collect { |tag| tag.name }.
|
24
|
+
expect(@parsed_files[file - 1].feature.tags).to eq(expected_tags)
|
25
|
+
expect(@parsed_files[file - 1].feature.tag_elements.collect { |tag| tag.name }).to eq(expected_tags)
|
26
26
|
end
|
27
27
|
|
28
28
|
Then /^feature "([^"]*)" has no description$/ do |file|
|
29
|
-
@parsed_files[file - 1].feature.description_text.
|
30
|
-
@parsed_files[file - 1].feature.description.
|
29
|
+
expect(@parsed_files[file - 1].feature.description_text).to eq('')
|
30
|
+
expect(@parsed_files[file - 1].feature.description).to eq([])
|
31
31
|
end
|
32
32
|
|
33
33
|
Then /^feature "([^"]*)" has no tags$/ do |file|
|
@@ -57,7 +57,7 @@ end
|
|
57
57
|
When /^(?:the )?feature(?: "([^"]*)")? background is as follows:$/ do |file, background|
|
58
58
|
file ||= 1
|
59
59
|
|
60
|
-
@parsed_files[file - 1].feature.background.name.
|
60
|
+
expect(@parsed_files[file - 1].feature.background.name).to eq(background.raw.flatten.first)
|
61
61
|
end
|
62
62
|
|
63
63
|
When /^feature "([^"]*)" has no scenarios$/ do |file|
|
@@ -77,11 +77,11 @@ Then /^(?:the )?feature(?: "([^"]*)")? correctly stores its underlying implement
|
|
77
77
|
|
78
78
|
raw_element = @parsed_files[file - 1].feature.raw_element
|
79
79
|
|
80
|
-
raw_element.
|
80
|
+
expect(raw_element).to have_key('elements')
|
81
81
|
end
|
82
82
|
|
83
83
|
Then(/^the feature has convenient output$/) do
|
84
|
-
@parsed_files.first.feature.method(:to_s).owner.
|
84
|
+
expect(@parsed_files.first.feature.method(:to_s).owner).to eq(CucumberAnalytics::Feature)
|
85
85
|
end
|
86
86
|
|
87
87
|
Given(/^a feature element based on the following gherkin:$/) do |feature_text|
|
@@ -91,6 +91,6 @@ end
|
|
91
91
|
def remove_whitespace(text)
|
92
92
|
stripped_text = text.split("\n").collect { |line| line.strip }
|
93
93
|
stripped_text.delete('')
|
94
|
-
|
94
|
+
|
95
95
|
stripped_text
|
96
|
-
end
|
96
|
+
end
|
@@ -16,7 +16,7 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^
|
|
16
16
|
properties = properties.rows_hash
|
17
17
|
|
18
18
|
properties.each do |property, value|
|
19
|
-
@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].send(property.to_sym).to_s.
|
19
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].send(property.to_sym).to_s).to eq(value)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -44,8 +44,8 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^
|
|
44
44
|
new_description = @parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].description_text
|
45
45
|
old_description = @parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].description
|
46
46
|
|
47
|
-
new_description.
|
48
|
-
old_description.
|
47
|
+
expect(new_description).to eq(text)
|
48
|
+
expect(old_description).to eq(remove_whitespace(text))
|
49
49
|
end
|
50
50
|
|
51
51
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^"]*)")? has no description$/ do |file, test, example|
|
@@ -56,8 +56,8 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^
|
|
56
56
|
new_description = @parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].description_text
|
57
57
|
old_description = @parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].description
|
58
58
|
|
59
|
-
new_description.
|
60
|
-
old_description.
|
59
|
+
expect(new_description).to eq('')
|
60
|
+
expect(old_description).to eq([])
|
61
61
|
end
|
62
62
|
|
63
63
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^"]*)")? is found to have the following tags:$/ do |file, test, example, expected_tags|
|
@@ -67,8 +67,8 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^
|
|
67
67
|
|
68
68
|
expected_tags = expected_tags.raw.flatten
|
69
69
|
|
70
|
-
@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].tags.
|
71
|
-
@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].tag_elements.collect { |tag| tag.name }.
|
70
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].tags).to eq(expected_tags)
|
71
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].tag_elements.collect { |tag| tag.name }).to eq(expected_tags)
|
72
72
|
end
|
73
73
|
|
74
74
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^"]*)")? is found to have the following applied tags:$/ do |file, test, example, expected_tags|
|
@@ -78,8 +78,8 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^
|
|
78
78
|
|
79
79
|
expected_tags = expected_tags.raw.flatten.sort
|
80
80
|
|
81
|
-
@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].applied_tags.sort.
|
82
|
-
@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].applied_tag_elements.collect { |tag| tag.name }.sort.
|
81
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].applied_tags.sort).to eq(expected_tags)
|
82
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].applied_tag_elements.collect { |tag| tag.name }.sort).to eq(expected_tags)
|
83
83
|
end
|
84
84
|
|
85
85
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^"]*)")? has no tags$/ do |file, test, example|
|
@@ -87,8 +87,8 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^
|
|
87
87
|
test ||= 1
|
88
88
|
example ||= 1
|
89
89
|
|
90
|
-
@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].tags.
|
91
|
-
@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].tag_elements.collect { |tag| tag.name }.
|
90
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].tags).to eq([])
|
91
|
+
expect(@parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].tag_elements.collect { |tag| tag.name }).to eq([])
|
92
92
|
end
|
93
93
|
|
94
94
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^"]*)")? rows are as follows:$/ do |file, test, example, rows|
|
@@ -181,9 +181,9 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^
|
|
181
181
|
|
182
182
|
example = @parsed_files[file - 1].feature.tests[test - 1].examples[example - 1]
|
183
183
|
|
184
|
-
example.row_elements[1..example.row_elements.count].
|
184
|
+
expect(example.row_elements[1..example.row_elements.count]).to be_empty
|
185
185
|
#todo - remove once Hash rows are no longer supported
|
186
|
-
example.rows.
|
186
|
+
expect(example.rows).to be_empty
|
187
187
|
end
|
188
188
|
|
189
189
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^"]*)")? row(?: "([^"]*)")? correctly stores its underlying implementation$/ do |file, test, example, row|
|
@@ -194,7 +194,7 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^
|
|
194
194
|
|
195
195
|
raw_element = @parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].row_elements[row - 1].raw_element
|
196
196
|
|
197
|
-
raw_element.
|
197
|
+
expect(raw_element).to have_key('cells')
|
198
198
|
end
|
199
199
|
|
200
200
|
Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^"]*)")? correctly stores its underlying implementation$/ do |file, test, example|
|
@@ -204,11 +204,11 @@ Then /^(?:the )?(?:feature "([^"]*)" )?test(?: "([^"]*)")? example block(?: "([^
|
|
204
204
|
|
205
205
|
raw_element = @parsed_files[file - 1].feature.tests[test - 1].examples[example - 1].raw_element
|
206
206
|
|
207
|
-
raw_element.
|
207
|
+
expect(raw_element).to have_key('rows')
|
208
208
|
end
|
209
209
|
|
210
210
|
Then(/^the row has convenient output$/) do
|
211
|
-
@parsed_files.first.feature.tests.first.examples.first.row_elements.first.method(:to_s).owner.
|
211
|
+
expect(@parsed_files.first.feature.tests.first.examples.first.row_elements.first.method(:to_s).owner).to eq(CucumberAnalytics::Row)
|
212
212
|
end
|
213
213
|
|
214
214
|
Given(/^a row element based on the following gherkin:$/) do |row_text|
|
@@ -224,7 +224,7 @@ When(/^the row element has no cells$/) do
|
|
224
224
|
end
|
225
225
|
|
226
226
|
Then(/^the example block has convenient output$/) do
|
227
|
-
@parsed_files.first.feature.tests.first.examples.first.method(:to_s).owner.
|
227
|
+
expect(@parsed_files.first.feature.tests.first.examples.first.method(:to_s).owner).to eq(CucumberAnalytics::Example)
|
228
228
|
end
|
229
229
|
|
230
230
|
Given(/^an example element based on the following gherkin:$/) do |example_text|
|
@@ -244,7 +244,7 @@ When(/^the example element has no parameters or rows$/) do
|
|
244
244
|
end
|
245
245
|
|
246
246
|
Then(/^the outline has convenient output$/) do
|
247
|
-
@parsed_files.first.feature.tests.first.method(:to_s).owner.
|
247
|
+
expect(@parsed_files.first.feature.tests.first.method(:to_s).owner).to eq(CucumberAnalytics::Outline)
|
248
248
|
end
|
249
249
|
|
250
250
|
Given(/^an outline element based on the following gherkin:$/) do |outline_text|
|