cuke_modeler 1.5.1 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +60 -1
- data/LICENSE.txt +1 -1
- data/README.md +13 -15
- data/cuke_modeler.gemspec +12 -9
- data/lib/cuke_modeler.rb +1 -0
- data/lib/cuke_modeler/adapters/gherkin_10_adapter.rb +12 -0
- data/lib/cuke_modeler/adapters/gherkin_11_adapter.rb +12 -0
- data/lib/cuke_modeler/adapters/gherkin_12_adapter.rb +12 -0
- data/lib/cuke_modeler/adapters/gherkin_13_adapter.rb +12 -0
- data/lib/cuke_modeler/adapters/gherkin_14_adapter.rb +12 -0
- data/lib/cuke_modeler/adapters/{gherkin_6_adapter.rb → gherkin_9_adapter.rb} +105 -69
- data/lib/cuke_modeler/containing.rb +16 -5
- data/lib/cuke_modeler/described.rb +1 -0
- data/lib/cuke_modeler/models/background.rb +1 -1
- data/lib/cuke_modeler/models/cell.rb +1 -1
- data/lib/cuke_modeler/models/comment.rb +1 -1
- data/lib/cuke_modeler/models/directory.rb +2 -2
- data/lib/cuke_modeler/models/doc_string.rb +1 -1
- data/lib/cuke_modeler/models/example.rb +1 -1
- data/lib/cuke_modeler/models/feature.rb +16 -5
- data/lib/cuke_modeler/models/feature_file.rb +2 -2
- data/lib/cuke_modeler/models/outline.rb +1 -1
- data/lib/cuke_modeler/models/row.rb +1 -1
- data/lib/cuke_modeler/models/rule.rb +99 -0
- data/lib/cuke_modeler/models/scenario.rb +1 -1
- data/lib/cuke_modeler/models/step.rb +32 -3
- data/lib/cuke_modeler/models/table.rb +1 -1
- data/lib/cuke_modeler/models/tag.rb +1 -1
- data/lib/cuke_modeler/named.rb +1 -0
- data/lib/cuke_modeler/nested.rb +1 -0
- data/lib/cuke_modeler/parsed.rb +1 -0
- data/lib/cuke_modeler/parsing.rb +89 -102
- data/lib/cuke_modeler/sourceable.rb +1 -0
- data/lib/cuke_modeler/stepped.rb +1 -0
- data/lib/cuke_modeler/taggable.rb +1 -0
- data/lib/cuke_modeler/version.rb +1 -1
- data/testing/cucumber/features/analysis/step_comparison.feature +25 -0
- data/testing/cucumber/features/analysis/test_comparison.feature +1 -1
- data/testing/cucumber/features/modeling/feature_modeling.feature +28 -7
- data/testing/cucumber/features/modeling/feature_output.feature +45 -23
- data/testing/cucumber/features/modeling/rule_modeling.feature +108 -0
- data/testing/cucumber/features/modeling/rule_output.feature +111 -0
- metadata +39 -140
- data/.gitignore +0 -18
- data/.simplecov +0 -7
- data/.travis.yml +0 -60
- data/Gemfile +0 -37
- data/Rakefile +0 -73
- data/appveyor.yml +0 -61
- data/lib/cuke_modeler/adapters/gherkin_2_adapter.rb +0 -273
- data/lib/cuke_modeler/adapters/gherkin_3_adapter.rb +0 -296
- data/lib/cuke_modeler/adapters/gherkin_4_adapter.rb +0 -308
- data/testing/cucumber/step_definitions/action_steps.rb +0 -13
- data/testing/cucumber/step_definitions/background_steps.rb +0 -1
- data/testing/cucumber/step_definitions/directory_steps.rb +0 -6
- data/testing/cucumber/step_definitions/doc_string_steps.rb +0 -1
- data/testing/cucumber/step_definitions/feature_file_steps.rb +0 -16
- data/testing/cucumber/step_definitions/feature_steps.rb +0 -7
- data/testing/cucumber/step_definitions/modeling_steps.rb +0 -44
- data/testing/cucumber/step_definitions/setup_steps.rb +0 -32
- data/testing/cucumber/step_definitions/step_steps.rb +0 -3
- data/testing/cucumber/step_definitions/table_steps.rb +0 -1
- data/testing/cucumber/step_definitions/tag_steps.rb +0 -3
- data/testing/cucumber/step_definitions/verification_steps.rb +0 -173
- data/testing/cucumber/support/env.rb +0 -30
- data/testing/dialect_helper.rb +0 -48
- data/testing/file_helper.rb +0 -47
- data/testing/gemfiles/gherkin2.gemfile +0 -33
- data/testing/gemfiles/gherkin3.gemfile +0 -26
- data/testing/gemfiles/gherkin4.gemfile +0 -27
- data/testing/gemfiles/gherkin5.gemfile +0 -27
- data/testing/gemfiles/gherkin6.gemfile +0 -10
- data/testing/rspec/spec/integration/adapters/gherkin_2_adapter_spec.rb +0 -166
- data/testing/rspec/spec/integration/adapters/gherkin_3_adapter_spec.rb +0 -166
- data/testing/rspec/spec/integration/adapters/gherkin_4_adapter_spec.rb +0 -165
- data/testing/rspec/spec/integration/adapters/gherkin_6_adapter_spec.rb +0 -166
- data/testing/rspec/spec/integration/models/background_integration_spec.rb +0 -442
- data/testing/rspec/spec/integration/models/cell_integration_spec.rb +0 -335
- data/testing/rspec/spec/integration/models/comment_integration_spec.rb +0 -177
- data/testing/rspec/spec/integration/models/directory_integration_spec.rb +0 -218
- data/testing/rspec/spec/integration/models/doc_string_integration_spec.rb +0 -402
- data/testing/rspec/spec/integration/models/example_integration_spec.rb +0 -741
- data/testing/rspec/spec/integration/models/feature_file_integration_spec.rb +0 -272
- data/testing/rspec/spec/integration/models/feature_integration_spec.rb +0 -650
- data/testing/rspec/spec/integration/models/model_integration_spec.rb +0 -15
- data/testing/rspec/spec/integration/models/outline_integration_spec.rb +0 -624
- data/testing/rspec/spec/integration/models/row_integration_spec.rb +0 -291
- data/testing/rspec/spec/integration/models/scenario_integration_spec.rb +0 -479
- data/testing/rspec/spec/integration/models/step_integration_spec.rb +0 -475
- data/testing/rspec/spec/integration/models/table_integration_spec.rb +0 -337
- data/testing/rspec/spec/integration/models/tag_integration_spec.rb +0 -259
- data/testing/rspec/spec/integration/nested_integration_spec.rb +0 -91
- data/testing/rspec/spec/integration/parsing_integration_spec.rb +0 -122
- data/testing/rspec/spec/integration/shared/models_integration_specs.rb +0 -18
- data/testing/rspec/spec/spec_helper.rb +0 -125
- data/testing/rspec/spec/unit/cuke_modeler_unit_spec.rb +0 -25
- data/testing/rspec/spec/unit/described_unit_spec.rb +0 -23
- data/testing/rspec/spec/unit/models/background_unit_spec.rb +0 -83
- data/testing/rspec/spec/unit/models/cell_unit_spec.rb +0 -68
- data/testing/rspec/spec/unit/models/comment_unit_spec.rb +0 -68
- data/testing/rspec/spec/unit/models/directory_unit_spec.rb +0 -127
- data/testing/rspec/spec/unit/models/doc_string_unit_spec.rb +0 -100
- data/testing/rspec/spec/unit/models/example_unit_spec.rb +0 -133
- data/testing/rspec/spec/unit/models/feature_file_unit_spec.rb +0 -125
- data/testing/rspec/spec/unit/models/feature_unit_spec.rb +0 -157
- data/testing/rspec/spec/unit/models/model_unit_spec.rb +0 -15
- data/testing/rspec/spec/unit/models/outline_unit_spec.rb +0 -117
- data/testing/rspec/spec/unit/models/row_unit_spec.rb +0 -68
- data/testing/rspec/spec/unit/models/scenario_unit_spec.rb +0 -86
- data/testing/rspec/spec/unit/models/step_unit_spec.rb +0 -109
- data/testing/rspec/spec/unit/models/table_unit_spec.rb +0 -77
- data/testing/rspec/spec/unit/models/tag_unit_spec.rb +0 -68
- data/testing/rspec/spec/unit/named_unit_spec.rb +0 -23
- data/testing/rspec/spec/unit/nested_unit_spec.rb +0 -43
- data/testing/rspec/spec/unit/parsed_unit_spec.rb +0 -27
- data/testing/rspec/spec/unit/parsing_unit_spec.rb +0 -54
- data/testing/rspec/spec/unit/shared/bare_bones_models_unit_specs.rb +0 -14
- data/testing/rspec/spec/unit/shared/containing_models_unit_specs.rb +0 -127
- data/testing/rspec/spec/unit/shared/described_models_unit_specs.rb +0 -38
- data/testing/rspec/spec/unit/shared/keyworded_models_unit_specs.rb +0 -58
- data/testing/rspec/spec/unit/shared/models_unit_specs.rb +0 -15
- data/testing/rspec/spec/unit/shared/named_models_unit_specs.rb +0 -39
- data/testing/rspec/spec/unit/shared/nested_models_unit_specs.rb +0 -51
- data/testing/rspec/spec/unit/shared/parsed_models_unit_specs.rb +0 -39
- data/testing/rspec/spec/unit/shared/prepopulated_models_unit_specs.rb +0 -18
- data/testing/rspec/spec/unit/shared/sourced_models_unit_specs.rb +0 -39
- data/testing/rspec/spec/unit/shared/stepped_models_unit_specs.rb +0 -46
- data/testing/rspec/spec/unit/shared/stringifiable_models_unit_specs.rb +0 -18
- data/testing/rspec/spec/unit/shared/tagged_models_unit_specs.rb +0 -72
- data/testing/rspec/spec/unit/sourceable_unit_spec.rb +0 -27
- data/testing/rspec/spec/unit/stepped_unit_spec.rb +0 -23
- data/testing/rspec/spec/unit/taggable_unit_spec.rb +0 -69
- data/testing/test_languages.json +0 -45
- data/todo.txt +0 -24
@@ -1,68 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../../spec_helper"
|
2
|
-
|
3
|
-
|
4
|
-
describe 'Cell, Unit', :unit_test => true do
|
5
|
-
|
6
|
-
let(:clazz) { CukeModeler::Cell }
|
7
|
-
let(:cell) { clazz.new }
|
8
|
-
|
9
|
-
|
10
|
-
describe 'common behavior' do
|
11
|
-
|
12
|
-
it_should_behave_like 'a model'
|
13
|
-
it_should_behave_like 'a sourced model'
|
14
|
-
it_should_behave_like 'a parsed model'
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
|
19
|
-
describe 'unique behavior' do
|
20
|
-
|
21
|
-
it 'has a value' do
|
22
|
-
expect(cell).to respond_to(:value)
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'can change its value' do
|
26
|
-
expect(cell).to respond_to(:value=)
|
27
|
-
|
28
|
-
cell.value = :some_value
|
29
|
-
expect(cell.value).to eq(:some_value)
|
30
|
-
cell.value = :some_other_value
|
31
|
-
expect(cell.value).to eq(:some_other_value)
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
describe 'abstract instantiation' do
|
36
|
-
|
37
|
-
context 'a new cell object' do
|
38
|
-
|
39
|
-
let(:cell) { clazz.new }
|
40
|
-
|
41
|
-
|
42
|
-
it 'starts with no value' do
|
43
|
-
expect(cell.value).to be_nil
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
describe 'cell output' do
|
52
|
-
|
53
|
-
context 'from abstract instantiation' do
|
54
|
-
|
55
|
-
let(:cell) { clazz.new }
|
56
|
-
|
57
|
-
|
58
|
-
it 'can output an empty cell' do
|
59
|
-
expect { cell.to_s }.to_not raise_error
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../../spec_helper"
|
2
|
-
|
3
|
-
|
4
|
-
describe 'Comment, Unit', :unit_test => true do
|
5
|
-
|
6
|
-
let(:clazz) { CukeModeler::Comment }
|
7
|
-
let(:model) { clazz.new }
|
8
|
-
|
9
|
-
|
10
|
-
describe 'common behavior' do
|
11
|
-
|
12
|
-
it_should_behave_like 'a model'
|
13
|
-
it_should_behave_like 'a sourced model'
|
14
|
-
it_should_behave_like 'a parsed model'
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
|
19
|
-
describe 'unique behavior' do
|
20
|
-
|
21
|
-
it 'has text' do
|
22
|
-
expect(model).to respond_to(:text)
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'can change its text' do
|
26
|
-
expect(model).to respond_to(:text=)
|
27
|
-
|
28
|
-
model.text = :some_text
|
29
|
-
expect(model.text).to eq(:some_text)
|
30
|
-
model.text = :some_other_text
|
31
|
-
expect(model.text).to eq(:some_other_text)
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
describe 'abstract instantiation' do
|
36
|
-
|
37
|
-
context 'a new comment object' do
|
38
|
-
|
39
|
-
let(:comment) { clazz.new }
|
40
|
-
|
41
|
-
|
42
|
-
it 'starts with no text' do
|
43
|
-
expect(comment.text).to be_nil
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
|
53
|
-
describe 'comment output' do
|
54
|
-
|
55
|
-
context 'from abstract instantiation' do
|
56
|
-
|
57
|
-
let(:comment) { clazz.new }
|
58
|
-
|
59
|
-
|
60
|
-
it 'can output an empty comment' do
|
61
|
-
expect { comment.to_s }.to_not raise_error
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
@@ -1,127 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../../spec_helper"
|
2
|
-
|
3
|
-
|
4
|
-
describe 'Directory, Unit', :unit_test => true do
|
5
|
-
|
6
|
-
let(:clazz) { CukeModeler::Directory }
|
7
|
-
let(:directory) { clazz.new }
|
8
|
-
|
9
|
-
|
10
|
-
describe 'common behavior' do
|
11
|
-
|
12
|
-
it_should_behave_like 'a model'
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
describe 'unique behavior' do
|
18
|
-
|
19
|
-
it 'has a name' do
|
20
|
-
expect(directory).to respond_to(:name)
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'derives its directory name from its path' do
|
24
|
-
directory.path = 'path/to/foo'
|
25
|
-
|
26
|
-
expect(directory.name).to eq('foo')
|
27
|
-
end
|
28
|
-
|
29
|
-
|
30
|
-
describe 'attributes' do
|
31
|
-
|
32
|
-
it 'has a path' do
|
33
|
-
expect(directory).to respond_to(:path)
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'can change its path' do
|
37
|
-
expect(directory).to respond_to(:path=)
|
38
|
-
|
39
|
-
directory.path = :some_path
|
40
|
-
expect(directory.path).to eq(:some_path)
|
41
|
-
directory.path = :some_other_path
|
42
|
-
expect(directory.path).to eq(:some_other_path)
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'has feature files' do
|
46
|
-
expect(directory).to respond_to(:feature_files)
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'can change its feature files' do
|
50
|
-
expect(directory).to respond_to(:feature_files=)
|
51
|
-
|
52
|
-
directory.feature_files = :some_feature_files
|
53
|
-
expect(directory.feature_files).to eq(:some_feature_files)
|
54
|
-
directory.feature_files = :some_other_feature_files
|
55
|
-
expect(directory.feature_files).to eq(:some_other_feature_files)
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'has directories' do
|
59
|
-
expect(directory).to respond_to(:directories)
|
60
|
-
end
|
61
|
-
|
62
|
-
it 'can change its directories' do
|
63
|
-
expect(directory).to respond_to(:directories=)
|
64
|
-
|
65
|
-
directory.directories = :some_directories
|
66
|
-
expect(directory.directories).to eq(:some_directories)
|
67
|
-
directory.directories = :some_other_directories
|
68
|
-
expect(directory.directories).to eq(:some_other_directories)
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
|
74
|
-
describe 'abstract instantiation' do
|
75
|
-
|
76
|
-
context 'a new directory object' do
|
77
|
-
|
78
|
-
let(:directory) { clazz.new }
|
79
|
-
|
80
|
-
|
81
|
-
it 'starts with no path' do
|
82
|
-
expect(directory.path).to be_nil
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'starts with no name' do
|
86
|
-
expect(directory.name).to be_nil
|
87
|
-
end
|
88
|
-
|
89
|
-
it 'starts with no feature files or directories' do
|
90
|
-
expect(directory.feature_files).to eq([])
|
91
|
-
expect(directory.directories).to eq([])
|
92
|
-
end
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
end
|
97
|
-
|
98
|
-
it 'contains feature files and directories' do
|
99
|
-
directories = [:directory_1, :directory_2, :directory_3]
|
100
|
-
files = [:file_1, :file_2, :file_3]
|
101
|
-
everything = files + directories
|
102
|
-
|
103
|
-
directory.directories = directories
|
104
|
-
directory.feature_files = files
|
105
|
-
|
106
|
-
expect(directory.children).to match_array(everything)
|
107
|
-
end
|
108
|
-
|
109
|
-
|
110
|
-
describe 'directory output' do
|
111
|
-
|
112
|
-
context 'from abstract instantiation' do
|
113
|
-
|
114
|
-
let(:directory) { clazz.new }
|
115
|
-
|
116
|
-
|
117
|
-
it 'can output an empty directory' do
|
118
|
-
expect { directory.to_s }.to_not raise_error
|
119
|
-
end
|
120
|
-
|
121
|
-
end
|
122
|
-
|
123
|
-
end
|
124
|
-
|
125
|
-
end
|
126
|
-
|
127
|
-
end
|
@@ -1,100 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../../spec_helper"
|
2
|
-
|
3
|
-
|
4
|
-
describe 'DocString, Unit', :unit_test => true do
|
5
|
-
|
6
|
-
let(:clazz) { CukeModeler::DocString }
|
7
|
-
let(:doc_string) { clazz.new }
|
8
|
-
|
9
|
-
describe 'common behavior' do
|
10
|
-
|
11
|
-
it_should_behave_like 'a model'
|
12
|
-
it_should_behave_like 'a parsed model'
|
13
|
-
it_should_behave_like 'a sourced model'
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
describe 'unique behavior' do
|
19
|
-
|
20
|
-
it 'has a content type' do
|
21
|
-
expect(doc_string).to respond_to(:content_type)
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'can change its content type' do
|
25
|
-
expect(doc_string).to respond_to(:content_type=)
|
26
|
-
|
27
|
-
doc_string.content_type = :some_content_type
|
28
|
-
expect(doc_string.content_type).to eq(:some_content_type)
|
29
|
-
doc_string.content_type = :some_other_content_type
|
30
|
-
expect(doc_string.content_type).to eq(:some_other_content_type)
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'has content' do
|
34
|
-
expect(doc_string).to respond_to(:content)
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'can change its content' do
|
38
|
-
expect(doc_string).to respond_to(:content=)
|
39
|
-
|
40
|
-
doc_string.content = :some_content
|
41
|
-
expect(doc_string.content).to eq(:some_content)
|
42
|
-
doc_string.content = :some_other_content
|
43
|
-
expect(doc_string.content).to eq(:some_other_content)
|
44
|
-
end
|
45
|
-
|
46
|
-
|
47
|
-
describe 'abstract instantiation' do
|
48
|
-
|
49
|
-
context 'a new doc string object' do
|
50
|
-
|
51
|
-
let(:doc_string) { clazz.new }
|
52
|
-
|
53
|
-
|
54
|
-
it 'starts with no content type' do
|
55
|
-
expect(doc_string.content_type).to be_nil
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'starts with no content' do
|
59
|
-
expect(doc_string.content).to be_nil
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
|
67
|
-
describe 'doc string output' do
|
68
|
-
|
69
|
-
context 'from abstract instantiation' do
|
70
|
-
|
71
|
-
context 'a new doc string object' do
|
72
|
-
|
73
|
-
let(:doc_string) { clazz.new }
|
74
|
-
|
75
|
-
|
76
|
-
it 'can output an empty doc string' do
|
77
|
-
expect { doc_string.to_s }.to_not raise_error
|
78
|
-
end
|
79
|
-
|
80
|
-
it 'can output a doc string that has only a content type' do
|
81
|
-
doc_string.content_type = 'some type'
|
82
|
-
|
83
|
-
expect { doc_string.to_s }.to_not raise_error
|
84
|
-
end
|
85
|
-
|
86
|
-
it 'can output a doc string that has only content' do
|
87
|
-
doc_string.content = 'foo'
|
88
|
-
|
89
|
-
expect { doc_string.to_s }.to_not raise_error
|
90
|
-
end
|
91
|
-
|
92
|
-
end
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
end
|
97
|
-
|
98
|
-
end
|
99
|
-
|
100
|
-
end
|
@@ -1,133 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../../spec_helper"
|
2
|
-
|
3
|
-
|
4
|
-
describe 'Example, Unit', :unit_test => true do
|
5
|
-
|
6
|
-
let(:clazz) { CukeModeler::Example }
|
7
|
-
let(:example) { clazz.new }
|
8
|
-
|
9
|
-
describe 'common behavior' do
|
10
|
-
|
11
|
-
it_should_behave_like 'a model'
|
12
|
-
it_should_behave_like 'a keyworded model'
|
13
|
-
it_should_behave_like 'a named model'
|
14
|
-
it_should_behave_like 'a described model'
|
15
|
-
it_should_behave_like 'a tagged model'
|
16
|
-
it_should_behave_like 'a sourced model'
|
17
|
-
it_should_behave_like 'a parsed model'
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
describe 'unique behavior' do
|
23
|
-
|
24
|
-
it 'has rows' do
|
25
|
-
expect(example).to respond_to(:rows)
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'can change its rows' do
|
29
|
-
expect(example).to respond_to(:rows=)
|
30
|
-
|
31
|
-
example.rows = :some_rows
|
32
|
-
expect(example.rows).to eq(:some_rows)
|
33
|
-
example.rows = :some_other_rows
|
34
|
-
expect(example.rows).to eq(:some_other_rows)
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'can selectively access its parameter row' do
|
38
|
-
expect(example).to respond_to(:parameter_row)
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'can selectively access its argument rows' do
|
42
|
-
expect(example).to respond_to(:argument_rows)
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'can determine its parameters' do
|
46
|
-
expect(example).to respond_to(:parameters)
|
47
|
-
end
|
48
|
-
|
49
|
-
|
50
|
-
describe 'abstract instantiation' do
|
51
|
-
|
52
|
-
context 'a new example object' do
|
53
|
-
|
54
|
-
let(:example) { clazz.new }
|
55
|
-
|
56
|
-
|
57
|
-
it 'starts with no rows' do
|
58
|
-
expect(example.rows).to eq([])
|
59
|
-
end
|
60
|
-
|
61
|
-
it 'starts with no argument rows' do
|
62
|
-
expect(example.argument_rows).to eq([])
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'starts with no parameter row' do
|
66
|
-
expect(example.parameter_row).to be_nil
|
67
|
-
end
|
68
|
-
|
69
|
-
it 'starts with no parameters' do
|
70
|
-
expect(example.parameters).to eq([])
|
71
|
-
end
|
72
|
-
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
|
-
|
77
|
-
|
78
|
-
it 'can add a new example row' do
|
79
|
-
expect(clazz.new).to respond_to(:add_row)
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'can remove an existing example row' do
|
83
|
-
expect(clazz.new).to respond_to(:remove_row)
|
84
|
-
end
|
85
|
-
|
86
|
-
it 'contains rows and tags' do
|
87
|
-
tags = [:tag_1, :tag_2]
|
88
|
-
rows = [:row_1, :row_2]
|
89
|
-
everything = rows + tags
|
90
|
-
|
91
|
-
example.rows = rows
|
92
|
-
example.tags = tags
|
93
|
-
|
94
|
-
expect(example.children).to match_array(everything)
|
95
|
-
end
|
96
|
-
|
97
|
-
|
98
|
-
describe 'example output' do
|
99
|
-
|
100
|
-
context 'from abstract instantiation' do
|
101
|
-
|
102
|
-
let(:example) { clazz.new }
|
103
|
-
|
104
|
-
|
105
|
-
it 'can output an empty example' do
|
106
|
-
expect { example.to_s }.to_not raise_error
|
107
|
-
end
|
108
|
-
|
109
|
-
it 'can output an example that has only a keyword' do
|
110
|
-
example.keyword = 'foo'
|
111
|
-
|
112
|
-
expect(example.to_s).to eq('foo:')
|
113
|
-
end
|
114
|
-
|
115
|
-
it 'can output an example that has only a name' do
|
116
|
-
example.name = 'a name'
|
117
|
-
|
118
|
-
expect { example.to_s }.to_not raise_error
|
119
|
-
end
|
120
|
-
|
121
|
-
it 'can output an example that has only a description' do
|
122
|
-
example.description = 'a description'
|
123
|
-
|
124
|
-
expect { example.to_s }.to_not raise_error
|
125
|
-
end
|
126
|
-
|
127
|
-
end
|
128
|
-
|
129
|
-
end
|
130
|
-
|
131
|
-
end
|
132
|
-
|
133
|
-
end
|