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
@@ -25,14 +25,14 @@ describe 'World, Integration' do
|
|
25
25
|
nested_container = double(:steps => @defined_steps)
|
26
26
|
container = double(:steps => @undefined_steps, :contains => [nested_container])
|
27
27
|
|
28
|
-
@defined_steps.
|
28
|
+
expect(@defined_steps).to match_array(@world.defined_steps_in(container))
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'can collect undefined steps from containers' do
|
32
32
|
nested_container = double(:steps => @defined_steps)
|
33
33
|
container = double(:steps => @undefined_steps, :contains => [nested_container])
|
34
34
|
|
35
|
-
@undefined_steps.
|
35
|
+
expect(@undefined_steps).to match_array(@world.undefined_steps_in(container))
|
36
36
|
end
|
37
37
|
|
38
38
|
end
|
@@ -21,7 +21,7 @@ describe 'Background, Unit' do
|
|
21
21
|
expect { @element = clazz.new(source) }.to_not raise_error
|
22
22
|
|
23
23
|
# Sanity check in case instantiation failed in a non-explosive manner
|
24
|
-
@element.name.
|
24
|
+
expect(@element.name).to eq('test background')
|
25
25
|
end
|
26
26
|
|
27
27
|
context 'background output edge cases' do
|
@@ -31,7 +31,7 @@ describe 'Background, Unit' do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'is a String' do
|
34
|
-
@background.to_s.
|
34
|
+
expect(@background.to_s).to be_a(String)
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'can output an empty background' do
|
@@ -7,11 +7,11 @@ shared_examples_for 'a containing element' do |clazz|
|
|
7
7
|
end
|
8
8
|
|
9
9
|
it 'has children - #contains' do
|
10
|
-
@element.
|
10
|
+
expect(@element.respond_to?(:contains)).to be true
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'returns a collection of children - #contains' do
|
14
|
-
@element.contains.
|
14
|
+
expect(@element.contains).to be_a(Array)
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
@@ -26,7 +26,7 @@ describe 'Directory, Unit' do
|
|
26
26
|
|
27
27
|
directory = CucumberAnalytics::Directory.new(path)
|
28
28
|
|
29
|
-
directory.name.
|
29
|
+
expect(directory.name).to eq('temp_files')
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'knows the path of the directory that it is modeling' do
|
@@ -34,46 +34,46 @@ describe 'Directory, Unit' do
|
|
34
34
|
|
35
35
|
directory = CucumberAnalytics::Directory.new(path)
|
36
36
|
|
37
|
-
directory.path.
|
37
|
+
expect(directory.path).to eq(path)
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'has feature files - #feature_files' do
|
41
|
-
@directory.
|
41
|
+
expect(@directory.respond_to?(:feature_files)).to be true
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'can get and set its feature files - #feature_files, #feature_files=' do
|
45
45
|
@directory.feature_files = :some_feature_files
|
46
|
-
@directory.feature_files.
|
46
|
+
expect(@directory.feature_files).to eq(:some_feature_files)
|
47
47
|
@directory.feature_files = :some_other_feature_files
|
48
|
-
@directory.feature_files.
|
48
|
+
expect(@directory.feature_files).to eq(:some_other_feature_files)
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'knows how many feature files it has - #feature_file_count' do
|
52
52
|
@directory.feature_files = [:file_1, :file_2, :file_3]
|
53
53
|
|
54
|
-
@directory.feature_file_count.
|
54
|
+
expect(@directory.feature_file_count).to eq(3)
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'has directories - #directories' do
|
58
|
-
@directory.
|
58
|
+
expect(@directory.respond_to?(:directories)).to be true
|
59
59
|
end
|
60
60
|
|
61
61
|
it 'can get and set its directories - #directories, #directories=' do
|
62
62
|
@directory.directories = :some_directories
|
63
|
-
@directory.directories.
|
63
|
+
expect(@directory.directories).to eq(:some_directories)
|
64
64
|
@directory.directories = :some_other_directories
|
65
|
-
@directory.directories.
|
65
|
+
expect(@directory.directories).to eq(:some_other_directories)
|
66
66
|
end
|
67
67
|
|
68
68
|
it 'knows how many directories it has - #directory_count' do
|
69
69
|
@directory.directories = [:directory_1, :directory_2, :directory_3]
|
70
70
|
|
71
|
-
@directory.directory_count.
|
71
|
+
expect(@directory.directory_count).to eq(3)
|
72
72
|
end
|
73
73
|
|
74
74
|
it 'starts with no feature files or directories' do
|
75
|
-
@directory.feature_files.
|
76
|
-
@directory.directories.
|
75
|
+
expect(@directory.feature_files).to eq([])
|
76
|
+
expect(@directory.directories).to eq([])
|
77
77
|
end
|
78
78
|
|
79
79
|
it 'contains feature files and directories' do
|
@@ -84,13 +84,13 @@ describe 'Directory, Unit' do
|
|
84
84
|
@directory.directories = directories
|
85
85
|
@directory.feature_files = files
|
86
86
|
|
87
|
-
@directory.contains.
|
87
|
+
expect(@directory.contains).to match_array(everything)
|
88
88
|
end
|
89
89
|
|
90
90
|
context 'directory output edge cases' do
|
91
91
|
|
92
92
|
it 'is a String' do
|
93
|
-
@directory.to_s.
|
93
|
+
expect(@directory.to_s).to be_a(String)
|
94
94
|
end
|
95
95
|
|
96
96
|
it 'can output an empty directory' do
|
@@ -17,9 +17,9 @@ describe 'DocString, Unit' do
|
|
17
17
|
expect { @element = clazz.new(source) }.to_not raise_error
|
18
18
|
|
19
19
|
# Sanity check in case instantiation failed in a non-explosive manner
|
20
|
-
@element.contents_text.
|
20
|
+
expect(@element.contents_text).to eq("some doc string")
|
21
21
|
#todo Remove once Array contents is no longer supported
|
22
|
-
@element.contents.
|
22
|
+
expect(@element.contents).to eq(["some doc string"])
|
23
23
|
end
|
24
24
|
|
25
25
|
before(:each) do
|
@@ -27,43 +27,43 @@ describe 'DocString, Unit' do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'has a content type - #content_type' do
|
30
|
-
@doc_string.
|
30
|
+
expect(@doc_string.respond_to?(:content_type)).to be true
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'can get and set its content type - #content_type, #content_type=' do
|
34
34
|
@doc_string.content_type = :some_content_type
|
35
|
-
@doc_string.content_type.
|
35
|
+
expect(@doc_string.content_type).to eq(:some_content_type)
|
36
36
|
@doc_string.content_type = :some_other_content_type
|
37
|
-
@doc_string.content_type.
|
37
|
+
expect(@doc_string.content_type).to eq(:some_other_content_type)
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'starts with no content type' do
|
41
|
-
@doc_string.content_type.
|
41
|
+
expect(@doc_string.content_type).to be_nil
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'has contents' do
|
45
45
|
#todo Remove once Array contents is no longer supported
|
46
|
-
@doc_string.
|
47
|
-
@doc_string.
|
46
|
+
expect(@doc_string.respond_to?(:contents)).to be true
|
47
|
+
expect(@doc_string.respond_to?(:contents_text)).to be true
|
48
48
|
end
|
49
49
|
|
50
50
|
it 'can get and set its contents' do
|
51
51
|
#todo Remove once Array contents is no longer supported
|
52
52
|
@doc_string.contents = :some_contents
|
53
|
-
@doc_string.contents.
|
53
|
+
expect(@doc_string.contents).to eq(:some_contents)
|
54
54
|
@doc_string.contents = :some_other_contents
|
55
|
-
@doc_string.contents.
|
55
|
+
expect(@doc_string.contents).to eq(:some_other_contents)
|
56
56
|
|
57
57
|
@doc_string.contents_text = :some_contents
|
58
|
-
@doc_string.contents_text.
|
58
|
+
expect(@doc_string.contents_text).to eq(:some_contents)
|
59
59
|
@doc_string.contents_text = :some_other_contents
|
60
|
-
@doc_string.contents_text.
|
60
|
+
expect(@doc_string.contents_text).to eq(:some_other_contents)
|
61
61
|
end
|
62
62
|
|
63
63
|
it 'starts with no contents' do
|
64
64
|
#todo Remove once Array contents is no longer supported
|
65
|
-
@doc_string.contents.
|
66
|
-
@doc_string.contents_text.
|
65
|
+
expect(@doc_string.contents).to eq([])
|
66
|
+
expect(@doc_string.contents_text).to eq('')
|
67
67
|
end
|
68
68
|
|
69
69
|
#todo Remove once Array contents is no longer supported
|
@@ -73,9 +73,9 @@ describe 'DocString, Unit' do
|
|
73
73
|
|
74
74
|
contents = doc_string.contents
|
75
75
|
|
76
|
-
contents.
|
76
|
+
expect(contents).to be_a(Array)
|
77
77
|
contents.each do |line|
|
78
|
-
line.
|
78
|
+
expect(line).to be_a(String)
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
@@ -85,13 +85,13 @@ describe 'DocString, Unit' do
|
|
85
85
|
|
86
86
|
contents = doc_string.contents_text
|
87
87
|
|
88
|
-
contents.
|
88
|
+
expect(contents).to be_a(String)
|
89
89
|
end
|
90
90
|
|
91
91
|
context 'doc string output edge cases' do
|
92
92
|
|
93
93
|
it 'is a String' do
|
94
|
-
@doc_string.to_s.
|
94
|
+
expect(@doc_string.to_s).to be_a(String)
|
95
95
|
end
|
96
96
|
|
97
97
|
it 'can output an empty doc string' do
|
@@ -25,7 +25,7 @@ describe 'Example, Unit' do
|
|
25
25
|
expect { @element = clazz.new(source) }.to_not raise_error
|
26
26
|
|
27
27
|
# Sanity check in case instantiation failed in a non-explosive manner
|
28
|
-
@element.name.
|
28
|
+
expect(@element.name).to eq('test example')
|
29
29
|
end
|
30
30
|
|
31
31
|
|
@@ -35,35 +35,35 @@ describe 'Example, Unit' do
|
|
35
35
|
|
36
36
|
|
37
37
|
it 'has parameters - #parameters' do
|
38
|
-
@example.
|
38
|
+
expect(@example.respond_to?(:parameters)).to be true
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'can get and set its parameters - #parameters, #parameters=' do
|
42
42
|
@example.parameters = :some_parameters
|
43
|
-
@example.parameters.
|
43
|
+
expect(@example.parameters).to eq(:some_parameters)
|
44
44
|
@example.parameters = :some_other_parameters
|
45
|
-
@example.parameters.
|
45
|
+
expect(@example.parameters).to eq(:some_other_parameters)
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'starts with no parameters' do
|
49
|
-
@example.parameters.
|
49
|
+
expect(@example.parameters).to eq([])
|
50
50
|
end
|
51
51
|
|
52
52
|
it 'has rows - #rows' do
|
53
|
-
@example.
|
53
|
+
expect(@example.respond_to?(:rows)).to be true
|
54
54
|
end
|
55
55
|
|
56
56
|
#todo - remove once Hash rows are no longer supported
|
57
57
|
it 'can get and set its rows - #rows, #rows=' do
|
58
58
|
@example.rows = :some_rows
|
59
|
-
@example.rows.
|
59
|
+
expect(@example.rows).to eq(:some_rows)
|
60
60
|
@example.rows = :some_other_rows
|
61
|
-
@example.rows.
|
61
|
+
expect(@example.rows).to eq(:some_other_rows)
|
62
62
|
end
|
63
63
|
|
64
64
|
#todo - remove once Hash rows are no longer supported
|
65
65
|
it 'starts with no rows' do
|
66
|
-
@example.rows.
|
66
|
+
expect(@example.rows).to eq([])
|
67
67
|
end
|
68
68
|
|
69
69
|
#todo - remove once Hash rows are no longer supported
|
@@ -73,9 +73,9 @@ describe 'Example, Unit' do
|
|
73
73
|
|
74
74
|
rows = example.rows
|
75
75
|
|
76
|
-
rows.
|
77
|
-
rows.empty
|
78
|
-
rows.each { |row| row.
|
76
|
+
expect(rows).to be_a(Array)
|
77
|
+
expect(rows.empty?).to be false
|
78
|
+
rows.each { |row| expect(row).to be_a(Hash) }
|
79
79
|
end
|
80
80
|
|
81
81
|
it 'does not include the parameter row as a row' do
|
@@ -84,28 +84,28 @@ describe 'Example, Unit' do
|
|
84
84
|
|
85
85
|
rows = example.rows
|
86
86
|
|
87
|
-
rows.
|
87
|
+
expect(rows).to eq([{'param1' => 'value1', 'param2' => 'value2'}, {'param1' => 'value3', 'param2' => 'value4'}])
|
88
88
|
end
|
89
89
|
|
90
90
|
it 'has row elements - #row_elements' do
|
91
|
-
@example.
|
91
|
+
expect(@example.respond_to?(:row_elements)).to be true
|
92
92
|
end
|
93
93
|
|
94
94
|
it 'can get and set its row elements - #row_elements, #row_elements=' do
|
95
95
|
@example.row_elements = :some_row_elements
|
96
|
-
@example.row_elements.
|
96
|
+
expect(@example.row_elements).to eq(:some_row_elements)
|
97
97
|
@example.row_elements = :some_other_row_elements
|
98
|
-
@example.row_elements.
|
98
|
+
expect(@example.row_elements).to eq(:some_other_row_elements)
|
99
99
|
end
|
100
100
|
|
101
101
|
it 'starts with no row elements' do
|
102
|
-
@example.row_elements.
|
102
|
+
expect(@example.row_elements).to eq([])
|
103
103
|
end
|
104
104
|
|
105
105
|
context '#add_row' do
|
106
106
|
|
107
107
|
it 'can add a new example row' do
|
108
|
-
clazz.new.
|
108
|
+
expect(clazz.new.respond_to?(:add_row)).to be true
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'can add a new row as a hash' do
|
@@ -116,8 +116,8 @@ describe 'Example, Unit' do
|
|
116
116
|
example.add_row(new_row)
|
117
117
|
|
118
118
|
#todo - remove once Hash rows are no longer supported
|
119
|
-
example.rows.
|
120
|
-
example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].
|
119
|
+
expect(example.rows).to eq([{'param1' => 'value1', 'param2' => 'value2'}, {'param1' => 'value3', 'param2' => 'value4'}])
|
120
|
+
expect(example.row_elements.collect { |row| row.cells }[1..example.row_elements.count]).to eq([['value1', 'value2'], ['value3', 'value4']])
|
121
121
|
end
|
122
122
|
|
123
123
|
it 'can add a new row as an array' do
|
@@ -128,8 +128,8 @@ describe 'Example, Unit' do
|
|
128
128
|
example.add_row(new_row)
|
129
129
|
|
130
130
|
#todo - remove once Hash rows are no longer supported
|
131
|
-
example.rows.
|
132
|
-
example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].
|
131
|
+
expect(example.rows).to eq([{'param1' => 'value1', 'param2' => 'value2'}, {'param1' => 'value3', 'param2' => 'value4'}])
|
132
|
+
expect(example.row_elements.collect { |row| row.cells }[1..example.row_elements.count]).to eq([['value1', 'value2'], ['value3', 'value4']])
|
133
133
|
end
|
134
134
|
|
135
135
|
it 'can only use a Hash or an Array to add a new row' do
|
@@ -148,15 +148,15 @@ describe 'Example, Unit' do
|
|
148
148
|
example.add_row(array_row)
|
149
149
|
|
150
150
|
#todo - remove once Hash rows are no longer supported
|
151
|
-
example.rows.
|
152
|
-
example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].
|
151
|
+
expect(example.rows).to eq([{'param1' => 'value1', 'param2' => 'value2'}, {'param1' => 'value3', 'param2' => 'value4'}, {'param1' => 'value5', 'param2' => 'value6'}])
|
152
|
+
expect(example.row_elements.collect { |row| row.cells }[1..example.row_elements.count]).to eq([['value1', 'value2'], ['value3', 'value4'], ['value5', 'value6']])
|
153
153
|
end
|
154
154
|
end
|
155
155
|
|
156
156
|
context '#remove_row' do
|
157
157
|
|
158
158
|
it 'can remove an existing example row' do
|
159
|
-
clazz.new.
|
159
|
+
expect(clazz.new.respond_to?(:remove_row)).to be true
|
160
160
|
end
|
161
161
|
|
162
162
|
it 'can remove an existing row as a hash' do
|
@@ -167,8 +167,8 @@ describe 'Example, Unit' do
|
|
167
167
|
example.remove_row(old_row)
|
168
168
|
|
169
169
|
#todo - remove once Hash rows are no longer supported
|
170
|
-
example.rows.
|
171
|
-
example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].
|
170
|
+
expect(example.rows).to eq([{'param1' => 'value1', 'param2' => 'value2'}])
|
171
|
+
expect(example.row_elements.collect { |row| row.cells }[1..example.row_elements.count]).to eq([['value1', 'value2']])
|
172
172
|
end
|
173
173
|
|
174
174
|
it 'can remove an existing row as an array' do
|
@@ -179,8 +179,8 @@ describe 'Example, Unit' do
|
|
179
179
|
example.remove_row(old_row)
|
180
180
|
|
181
181
|
#todo - remove once Hash rows are no longer supported
|
182
|
-
example.rows.
|
183
|
-
example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].
|
182
|
+
expect(example.rows).to eq([{'param1' => 'value1', 'param2' => 'value2'}])
|
183
|
+
expect(example.row_elements.collect { |row| row.cells }[1..example.row_elements.count]).to eq([['value1', 'value2']])
|
184
184
|
end
|
185
185
|
|
186
186
|
it 'can only use a Hash or an Array to remove an existing row' do
|
@@ -199,15 +199,15 @@ describe 'Example, Unit' do
|
|
199
199
|
example.remove_row(array_row)
|
200
200
|
|
201
201
|
#todo - remove once Hash rows are no longer supported
|
202
|
-
example.rows.
|
203
|
-
example.row_elements.collect { |row| row.cells }[1..example.row_elements.count].
|
202
|
+
expect(example.rows).to eq([{'param1' => 'value1', 'param2' => 'value2'}])
|
203
|
+
expect(example.row_elements.collect { |row| row.cells }[1..example.row_elements.count]).to eq([['value1', 'value2']])
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
207
207
|
context 'example output edge cases' do
|
208
208
|
|
209
209
|
it 'is a String' do
|
210
|
-
@example.to_s.
|
210
|
+
expect(@example.to_s).to be_a(String)
|
211
211
|
end
|
212
212
|
|
213
213
|
it 'can output an empty example' do
|
@@ -7,40 +7,40 @@ shared_examples_for 'a feature element' do |clazz|
|
|
7
7
|
end
|
8
8
|
|
9
9
|
it 'has a name - #name' do
|
10
|
-
@element.
|
10
|
+
expect(@element.respond_to?(:name)).to be true
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'can get and set its name - #name, #name=' do
|
14
14
|
@element.name = :some_name
|
15
|
-
@element.name.
|
15
|
+
expect(@element.name).to eq(:some_name)
|
16
16
|
@element.name = :some_other_name
|
17
|
-
@element.name.
|
17
|
+
expect(@element.name).to eq(:some_other_name)
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'has a description' do
|
21
|
-
@element.
|
22
|
-
@element.
|
21
|
+
expect(@element.respond_to?(:description)).to be true
|
22
|
+
expect(@element.respond_to?(:description_text)).to be true
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'can get and set its description' do
|
26
26
|
@element.description = :some_description
|
27
|
-
@element.description.
|
27
|
+
expect(@element.description).to eq(:some_description)
|
28
28
|
@element.description = :some_other_description
|
29
|
-
@element.description.
|
29
|
+
expect(@element.description).to eq(:some_other_description)
|
30
30
|
|
31
31
|
@element.description_text = :some_description
|
32
|
-
@element.description_text.
|
32
|
+
expect(@element.description_text).to eq(:some_description)
|
33
33
|
@element.description_text = :some_other_description
|
34
|
-
@element.description_text.
|
34
|
+
expect(@element.description_text).to eq(:some_other_description)
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'starts with no name' do
|
38
|
-
@element.name.
|
38
|
+
expect(@element.name).to eq('')
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'starts with no description' do
|
42
|
-
@element.description.
|
43
|
-
@element.description_text.
|
42
|
+
expect(@element.description).to eq([])
|
43
|
+
expect(@element.description_text).to eq('')
|
44
44
|
end
|
45
45
|
|
46
46
|
end
|