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,125 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../../spec_helper"
|
2
|
-
|
3
|
-
|
4
|
-
describe 'FeatureFile, Unit', :unit_test => true do
|
5
|
-
|
6
|
-
let(:clazz) { CukeModeler::FeatureFile }
|
7
|
-
let(:feature_file) { clazz.new }
|
8
|
-
|
9
|
-
|
10
|
-
describe 'common behavior' do
|
11
|
-
|
12
|
-
it_should_behave_like 'a model'
|
13
|
-
it_should_behave_like 'a parsed model'
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
describe 'unique behavior' do
|
19
|
-
|
20
|
-
it 'has a path' do
|
21
|
-
expect(feature_file).to respond_to(:path)
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'can change its path' do
|
25
|
-
expect(feature_file).to respond_to(:path=)
|
26
|
-
|
27
|
-
feature_file.path = :some_path
|
28
|
-
expect(feature_file.path).to eq(:some_path)
|
29
|
-
feature_file.path = :some_other_path
|
30
|
-
expect(feature_file.path).to eq(:some_other_path)
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'has a feature' do
|
34
|
-
expect(feature_file).to respond_to(:feature)
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'can change its feature' do
|
38
|
-
expect(feature_file).to respond_to(:feature=)
|
39
|
-
|
40
|
-
feature_file.feature = :some_features
|
41
|
-
expect(feature_file.feature).to eq(:some_features)
|
42
|
-
feature_file.feature = :some_other_features
|
43
|
-
expect(feature_file.feature).to eq(:some_other_features)
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'has comments' do
|
47
|
-
expect(feature_file).to respond_to(:comments)
|
48
|
-
end
|
49
|
-
|
50
|
-
it 'can change its comments' do
|
51
|
-
expect(feature_file).to respond_to(:comments=)
|
52
|
-
|
53
|
-
feature_file.comments = :some_comments
|
54
|
-
expect(feature_file.comments).to eq(:some_comments)
|
55
|
-
feature_file.comments = :some_other_comments
|
56
|
-
expect(feature_file.comments).to eq(:some_other_comments)
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'knows the name of the file that it is modeling' do
|
60
|
-
expect(feature_file).to respond_to(:name)
|
61
|
-
end
|
62
|
-
|
63
|
-
|
64
|
-
it 'derives its file name from its path' do
|
65
|
-
feature_file.path = 'path/to/foo'
|
66
|
-
|
67
|
-
expect(feature_file.name).to eq('foo')
|
68
|
-
end
|
69
|
-
|
70
|
-
|
71
|
-
describe 'abstract instantiation' do
|
72
|
-
|
73
|
-
context 'a new feature file object' do
|
74
|
-
|
75
|
-
let(:feature_file) { clazz.new }
|
76
|
-
|
77
|
-
|
78
|
-
it 'starts with no path' do
|
79
|
-
expect(feature_file.path).to be_nil
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'starts with no name' do
|
83
|
-
expect(feature_file.name).to be_nil
|
84
|
-
end
|
85
|
-
|
86
|
-
it 'starts with no feature' do
|
87
|
-
expect(feature_file.feature).to be_nil
|
88
|
-
end
|
89
|
-
|
90
|
-
it 'starts with no comments' do
|
91
|
-
expect(feature_file.comments).to eq([])
|
92
|
-
end
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
end
|
97
|
-
|
98
|
-
it 'contains a feature' do
|
99
|
-
feature = :a_feature
|
100
|
-
everything = [feature]
|
101
|
-
|
102
|
-
feature_file.feature = feature
|
103
|
-
|
104
|
-
expect(feature_file.children).to match_array(everything)
|
105
|
-
end
|
106
|
-
|
107
|
-
|
108
|
-
describe 'feature file output' do
|
109
|
-
|
110
|
-
context 'from abstract instantiation' do
|
111
|
-
|
112
|
-
let(:feature_file) { clazz.new }
|
113
|
-
|
114
|
-
|
115
|
-
it 'can output an empty feature file' do
|
116
|
-
expect { feature_file.to_s }.to_not raise_error
|
117
|
-
end
|
118
|
-
|
119
|
-
end
|
120
|
-
|
121
|
-
end
|
122
|
-
|
123
|
-
end
|
124
|
-
|
125
|
-
end
|
@@ -1,157 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../../spec_helper"
|
2
|
-
|
3
|
-
|
4
|
-
describe 'Feature, Unit', :unit_test => true do
|
5
|
-
|
6
|
-
let(:clazz) { CukeModeler::Feature }
|
7
|
-
let(:feature) { clazz.new }
|
8
|
-
|
9
|
-
|
10
|
-
describe 'common behavior' do
|
11
|
-
|
12
|
-
it_should_behave_like 'a model'
|
13
|
-
it_should_behave_like 'a keyworded model'
|
14
|
-
it_should_behave_like 'a named model'
|
15
|
-
it_should_behave_like 'a described model'
|
16
|
-
it_should_behave_like 'a tagged model'
|
17
|
-
it_should_behave_like 'a sourced model'
|
18
|
-
it_should_behave_like 'a parsed model'
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
|
23
|
-
describe 'unique behavior' do
|
24
|
-
|
25
|
-
it 'will complain about unknown element types' do
|
26
|
-
parsed_element = {'description' => '',
|
27
|
-
'elements' => [{'keyword' => 'Scenario', 'description' => ''},
|
28
|
-
{'keyword' => 'New Type', 'description' => ''}]}
|
29
|
-
|
30
|
-
expect { clazz.new(parsed_element) }.to raise_error(ArgumentError)
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'has a background' do
|
34
|
-
expect(feature).to respond_to(:background)
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'can change its background' do
|
38
|
-
expect(feature).to respond_to(:background=)
|
39
|
-
|
40
|
-
feature.background = :some_background
|
41
|
-
expect(feature.background).to eq(:some_background)
|
42
|
-
feature.background = :some_other_background
|
43
|
-
expect(feature.background).to eq(:some_other_background)
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'knows whether or not it presently has a background - has_background?' do
|
47
|
-
feature.background = :a_background
|
48
|
-
expect(feature).to have_background
|
49
|
-
feature.background = nil
|
50
|
-
expect(feature).to_not have_background
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'has tests' do
|
54
|
-
expect(feature).to respond_to(:tests)
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'can change its tests' do
|
58
|
-
expect(feature).to respond_to(:tests=)
|
59
|
-
|
60
|
-
feature.tests = :some_tests
|
61
|
-
expect(feature.tests).to eq(:some_tests)
|
62
|
-
feature.tests = :some_other_tests
|
63
|
-
expect(feature.tests).to eq(:some_other_tests)
|
64
|
-
end
|
65
|
-
|
66
|
-
it 'can selectively access its scenarios' do
|
67
|
-
expect(feature).to respond_to(:scenarios)
|
68
|
-
end
|
69
|
-
|
70
|
-
it 'can selectively access its outlines' do
|
71
|
-
expect(feature).to respond_to(:outlines)
|
72
|
-
end
|
73
|
-
|
74
|
-
it 'finds no scenarios or outlines when it has no tests' do
|
75
|
-
feature.tests = []
|
76
|
-
|
77
|
-
expect(feature.scenarios).to be_empty
|
78
|
-
expect(feature.outlines).to be_empty
|
79
|
-
end
|
80
|
-
|
81
|
-
it 'contains a background, tests, and tags' do
|
82
|
-
tags = [:tag_1, :tagt_2]
|
83
|
-
tests = [:test_1, :test_2]
|
84
|
-
background = :a_background
|
85
|
-
everything = [background] + tests + tags
|
86
|
-
|
87
|
-
feature.background = background
|
88
|
-
feature.tests = tests
|
89
|
-
feature.tags = tags
|
90
|
-
|
91
|
-
expect(feature.children).to match_array(everything)
|
92
|
-
end
|
93
|
-
|
94
|
-
it 'contains a background only if one is present' do
|
95
|
-
tests = [:test_1, :test_2]
|
96
|
-
background = nil
|
97
|
-
everything = tests
|
98
|
-
|
99
|
-
feature.background = background
|
100
|
-
feature.tests = tests
|
101
|
-
|
102
|
-
expect(feature.children).to match_array(everything)
|
103
|
-
end
|
104
|
-
|
105
|
-
|
106
|
-
context 'from abstract instantiation' do
|
107
|
-
|
108
|
-
let(:feature) { clazz.new }
|
109
|
-
|
110
|
-
|
111
|
-
it 'starts with no background' do
|
112
|
-
expect(feature.background).to be_nil
|
113
|
-
end
|
114
|
-
|
115
|
-
it 'starts with no tests' do
|
116
|
-
expect(feature.tests).to eq([])
|
117
|
-
end
|
118
|
-
|
119
|
-
end
|
120
|
-
|
121
|
-
|
122
|
-
describe 'feature output' do
|
123
|
-
|
124
|
-
context 'from abstract instantiation' do
|
125
|
-
|
126
|
-
let(:feature) { clazz.new }
|
127
|
-
|
128
|
-
|
129
|
-
it 'can output an empty feature' do
|
130
|
-
expect { feature.to_s }.to_not raise_error
|
131
|
-
end
|
132
|
-
|
133
|
-
it 'can output a feature that has only a keyword' do
|
134
|
-
feature.keyword = 'foo'
|
135
|
-
|
136
|
-
expect(feature.to_s).to eq('foo:')
|
137
|
-
end
|
138
|
-
|
139
|
-
it 'can output a feature that has only a name' do
|
140
|
-
feature.name = 'a name'
|
141
|
-
|
142
|
-
expect { feature.to_s }.to_not raise_error
|
143
|
-
end
|
144
|
-
|
145
|
-
it 'can output a feature that has only a description' do
|
146
|
-
feature.description = 'a description'
|
147
|
-
|
148
|
-
expect { feature.to_s }.to_not raise_error
|
149
|
-
end
|
150
|
-
|
151
|
-
end
|
152
|
-
|
153
|
-
end
|
154
|
-
|
155
|
-
end
|
156
|
-
|
157
|
-
end
|
@@ -1,117 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../../spec_helper"
|
2
|
-
|
3
|
-
|
4
|
-
describe 'Outline, Unit', :unit_test => true do
|
5
|
-
|
6
|
-
let(:clazz) { CukeModeler::Outline }
|
7
|
-
let(:outline) { clazz.new }
|
8
|
-
|
9
|
-
|
10
|
-
describe 'common behavior' do
|
11
|
-
|
12
|
-
it_should_behave_like 'a model'
|
13
|
-
it_should_behave_like 'a keyworded model'
|
14
|
-
it_should_behave_like 'a named model'
|
15
|
-
it_should_behave_like 'a described model'
|
16
|
-
it_should_behave_like 'a stepped model'
|
17
|
-
it_should_behave_like 'a tagged model'
|
18
|
-
it_should_behave_like 'a sourced model'
|
19
|
-
it_should_behave_like 'a parsed model'
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
describe 'unique behavior' do
|
25
|
-
|
26
|
-
it 'has examples' do
|
27
|
-
expect(outline).to respond_to(:examples)
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'can change its examples' do
|
31
|
-
expect(outline).to respond_to(:examples=)
|
32
|
-
|
33
|
-
outline.examples = :some_examples
|
34
|
-
expect(outline.examples).to eq(:some_examples)
|
35
|
-
outline.examples = :some_other_examples
|
36
|
-
expect(outline.examples).to eq(:some_other_examples)
|
37
|
-
end
|
38
|
-
|
39
|
-
|
40
|
-
describe 'abstract instantiation' do
|
41
|
-
|
42
|
-
context 'a new outline object' do
|
43
|
-
|
44
|
-
let(:outline) { clazz.new }
|
45
|
-
|
46
|
-
|
47
|
-
it 'starts with no examples' do
|
48
|
-
expect(outline.examples).to eq([])
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
it 'contains steps, examples, and tags' do
|
56
|
-
tags = [:tag_1, :tagt_2]
|
57
|
-
steps = [:step_1, :step_2, :step_3]
|
58
|
-
examples = [:example_1, :example_2, :example_3]
|
59
|
-
everything = steps + examples + tags
|
60
|
-
|
61
|
-
outline.steps = steps
|
62
|
-
outline.examples = examples
|
63
|
-
outline.tags = tags
|
64
|
-
|
65
|
-
expect(outline.children).to match_array(everything)
|
66
|
-
end
|
67
|
-
|
68
|
-
|
69
|
-
describe 'comparison' do
|
70
|
-
|
71
|
-
it 'can gracefully be compared to other types of objects' do
|
72
|
-
# Some common types of object
|
73
|
-
[1, 'foo', :bar, [], {}].each do |thing|
|
74
|
-
expect { outline == thing }.to_not raise_error
|
75
|
-
expect(outline == thing).to be false
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
|
82
|
-
describe 'outline output' do
|
83
|
-
|
84
|
-
context 'from abstract instantiation' do
|
85
|
-
|
86
|
-
let(:outline) { clazz.new }
|
87
|
-
|
88
|
-
|
89
|
-
it 'can output an empty outline' do
|
90
|
-
expect { outline.to_s }.to_not raise_error
|
91
|
-
end
|
92
|
-
|
93
|
-
it 'can output an outline that has only a keyword' do
|
94
|
-
outline.keyword = 'foo'
|
95
|
-
|
96
|
-
expect(outline.to_s).to eq('foo:')
|
97
|
-
end
|
98
|
-
|
99
|
-
it 'can output an outline that has only a name' do
|
100
|
-
outline.name = 'a name'
|
101
|
-
|
102
|
-
expect { outline.to_s }.to_not raise_error
|
103
|
-
end
|
104
|
-
|
105
|
-
it 'can output an outline that has only a description' do
|
106
|
-
outline.description = 'a description'
|
107
|
-
|
108
|
-
expect { outline.to_s }.to_not raise_error
|
109
|
-
end
|
110
|
-
|
111
|
-
end
|
112
|
-
|
113
|
-
end
|
114
|
-
|
115
|
-
end
|
116
|
-
|
117
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../../spec_helper"
|
2
|
-
|
3
|
-
|
4
|
-
describe 'Row, Unit', :unit_test => true do
|
5
|
-
|
6
|
-
let(:clazz) { CukeModeler::Row }
|
7
|
-
let(:row) { 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 cells' do
|
22
|
-
expect(row).to respond_to(:cells)
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'can change its cells' do
|
26
|
-
expect(row).to respond_to(:cells=)
|
27
|
-
|
28
|
-
row.cells = :some_cells
|
29
|
-
expect(row.cells).to eq(:some_cells)
|
30
|
-
row.cells = :some_other_cells
|
31
|
-
expect(row.cells).to eq(:some_other_cells)
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
describe 'abstract instantiation' do
|
36
|
-
|
37
|
-
context 'a new row object' do
|
38
|
-
|
39
|
-
let(:row) { clazz.new }
|
40
|
-
|
41
|
-
|
42
|
-
it 'starts with no cells' do
|
43
|
-
expect(row.cells).to eq([])
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
describe 'row output' do
|
52
|
-
|
53
|
-
context 'from abstract instantiation' do
|
54
|
-
|
55
|
-
let(:row) { clazz.new }
|
56
|
-
|
57
|
-
|
58
|
-
it 'can output an empty row' do
|
59
|
-
expect { row.to_s }.to_not raise_error
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|