cuke_modeler 1.5.0 → 1.5.1
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.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +292 -0
- data/Gemfile +1 -0
- data/README.md +14 -4
- data/Rakefile +41 -31
- data/appveyor.yml +1 -1
- data/cuke_modeler.gemspec +4 -1
- data/lib/cuke_modeler/containing.rb +2 -0
- data/lib/cuke_modeler/parsing.rb +8 -0
- data/lib/cuke_modeler/version.rb +1 -1
- data/testing/gemfiles/gherkin2.gemfile +1 -0
- data/testing/rspec/spec/integration/{gherkin_2_adapter_spec.rb → adapters/gherkin_2_adapter_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{gherkin_3_adapter_spec.rb → adapters/gherkin_3_adapter_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{gherkin_4_adapter_spec.rb → adapters/gherkin_4_adapter_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{gherkin_6_adapter_spec.rb → adapters/gherkin_6_adapter_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{background_integration_spec.rb → models/background_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{cell_integration_spec.rb → models/cell_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{comment_integration_spec.rb → models/comment_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{directory_integration_spec.rb → models/directory_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{doc_string_integration_spec.rb → models/doc_string_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{example_integration_spec.rb → models/example_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{feature_file_integration_spec.rb → models/feature_file_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{feature_integration_spec.rb → models/feature_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{model_integration_spec.rb → models/model_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{outline_integration_spec.rb → models/outline_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{row_integration_spec.rb → models/row_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{scenario_integration_spec.rb → models/scenario_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{step_integration_spec.rb → models/step_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{table_integration_spec.rb → models/table_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{tag_integration_spec.rb → models/tag_integration_spec.rb} +1 -1
- data/testing/rspec/spec/spec_helper.rb +3 -0
- data/testing/rspec/spec/unit/cuke_modeler_unit_spec.rb +25 -0
- data/testing/rspec/spec/unit/{background_unit_spec.rb → models/background_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{cell_unit_spec.rb → models/cell_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{comment_unit_spec.rb → models/comment_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{directory_unit_spec.rb → models/directory_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{doc_string_unit_spec.rb → models/doc_string_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{example_unit_spec.rb → models/example_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{feature_file_unit_spec.rb → models/feature_file_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{feature_unit_spec.rb → models/feature_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{model_unit_spec.rb → models/model_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{outline_unit_spec.rb → models/outline_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{row_unit_spec.rb → models/row_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{scenario_unit_spec.rb → models/scenario_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{step_unit_spec.rb → models/step_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{table_unit_spec.rb → models/table_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{tag_unit_spec.rb → models/tag_unit_spec.rb} +1 -1
- metadata +60 -42
- data/History.md +0 -196
data/appveyor.yml
CHANGED
data/cuke_modeler.gemspec
CHANGED
@@ -18,15 +18,18 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.required_ruby_version = '>= 1.8.7', '< 3.0'
|
22
|
+
|
21
23
|
spec.add_runtime_dependency 'gherkin', '< 7.0'
|
22
24
|
spec.add_runtime_dependency('json', '>= 1.0', '< 3.0')
|
23
25
|
spec.add_runtime_dependency('multi_json', '~> 1.0')
|
24
26
|
|
25
|
-
spec.add_development_dependency
|
27
|
+
spec.add_development_dependency 'bundler', '< 3.0'
|
26
28
|
spec.add_development_dependency "rake", '< 13.0.0'
|
27
29
|
spec.add_development_dependency 'cucumber', '< 5.0.0'
|
28
30
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
29
31
|
spec.add_development_dependency 'simplecov', '< 1.0.0'
|
30
32
|
spec.add_development_dependency 'racatt', '~> 1.0'
|
31
33
|
spec.add_development_dependency 'coveralls', '< 1.0.0'
|
34
|
+
spec.add_development_dependency 'rainbow', '< 4.0.0'
|
32
35
|
end
|
@@ -4,6 +4,7 @@ module CukeModeler
|
|
4
4
|
|
5
5
|
module Containing
|
6
6
|
|
7
|
+
# Executes the given code block with every model that is a child of this model.
|
7
8
|
def each_descendant(&block)
|
8
9
|
children.each do |child_model|
|
9
10
|
block.call(child_model)
|
@@ -11,6 +12,7 @@ module CukeModeler
|
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
15
|
+
# Executes the given code block with this model and every model that is a child of this model.
|
14
16
|
def each_model(&block)
|
15
17
|
block.call(self)
|
16
18
|
|
data/lib/cuke_modeler/parsing.rb
CHANGED
@@ -30,12 +30,14 @@ module CukeModeler
|
|
30
30
|
require 'gherkin/gherkin'
|
31
31
|
require 'cuke_modeler/adapters/gherkin_6_adapter'
|
32
32
|
|
33
|
+
# The method to use for parsing Gherkin text
|
33
34
|
def self.parsing_method(source_text, filename)
|
34
35
|
messages = Gherkin::Gherkin.from_source(filename, source_text, {:default_dialect => CukeModeler::Parsing.dialect}).to_a
|
35
36
|
|
36
37
|
messages.map(&:to_hash).find { |message| message[:gherkinDocument] }[:gherkinDocument]
|
37
38
|
end
|
38
39
|
|
40
|
+
# The adapter to use when converting an AST to a standard internal shape
|
39
41
|
def self.adapter_class
|
40
42
|
CukeModeler::Gherkin6Adapter
|
41
43
|
end
|
@@ -46,11 +48,13 @@ module CukeModeler
|
|
46
48
|
|
47
49
|
|
48
50
|
# todo - make these methods private?
|
51
|
+
# The method to use for parsing Gherkin text
|
49
52
|
# Filename isn't used by this version of Gherkin but keeping the parameter so that the calling method only has to know one method signature
|
50
53
|
def self.parsing_method(source_text, _filename)
|
51
54
|
Gherkin::Parser.new.parse(source_text)
|
52
55
|
end
|
53
56
|
|
57
|
+
# The adapter to use when converting an AST to a standard internal shape
|
54
58
|
def self.adapter_class
|
55
59
|
CukeModeler::Gherkin4Adapter
|
56
60
|
end
|
@@ -60,11 +64,13 @@ module CukeModeler
|
|
60
64
|
require 'cuke_modeler/adapters/gherkin_3_adapter'
|
61
65
|
|
62
66
|
|
67
|
+
# The method to use for parsing Gherkin text
|
63
68
|
# Filename isn't used by this version of Gherkin but keeping the parameter so that the calling method only has to know one method signature
|
64
69
|
def self.parsing_method(source_text, _filename)
|
65
70
|
Gherkin::Parser.new.parse(source_text)
|
66
71
|
end
|
67
72
|
|
73
|
+
# The adapter to use when converting an AST to a standard internal shape
|
68
74
|
def self.adapter_class
|
69
75
|
CukeModeler::Gherkin3Adapter
|
70
76
|
end
|
@@ -77,6 +83,7 @@ module CukeModeler
|
|
77
83
|
require 'cuke_modeler/adapters/gherkin_2_adapter'
|
78
84
|
|
79
85
|
|
86
|
+
# The method to use for parsing Gherkin text
|
80
87
|
def self.parsing_method(source_text, filename)
|
81
88
|
io = StringIO.new
|
82
89
|
formatter = Gherkin::Formatter::JSONFormatter.new(io)
|
@@ -86,6 +93,7 @@ module CukeModeler
|
|
86
93
|
MultiJson.load(io.string)
|
87
94
|
end
|
88
95
|
|
96
|
+
# The adapter to use when converting an AST to a standard internal shape
|
89
97
|
def self.adapter_class
|
90
98
|
CukeModeler::Gherkin2Adapter
|
91
99
|
end
|
data/lib/cuke_modeler/version.rb
CHANGED
@@ -18,6 +18,7 @@ if RUBY_VERSION =~ /^1\./
|
|
18
18
|
|
19
19
|
if RUBY_VERSION =~ /^1\.8/
|
20
20
|
gem 'cucumber', '~> 1.0' # Ruby 1.8.x support dropped after this version
|
21
|
+
gem 'rainbow', '< 2.0' # Ruby 1.8.x support dropped after this version
|
21
22
|
gem 'rake', '< 11.0' # Ruby 1.8.x support dropped after this version
|
22
23
|
else
|
23
24
|
gem 'rake', '< 12.3.0' # Ruby 1.9.x support dropped after this version
|
@@ -26,6 +26,9 @@ require "#{this_dir}/unit/shared/keyworded_models_unit_specs"
|
|
26
26
|
require "#{this_dir}/../../dialect_helper"
|
27
27
|
require "#{this_dir}/../../file_helper"
|
28
28
|
|
29
|
+
require 'rubygems/mock_gem_ui'
|
30
|
+
|
31
|
+
|
29
32
|
# Use a random dialect for testing in order to avoid hard coded language assumptions in the
|
30
33
|
# implementation and making the test dialect the default dialect so that language headers
|
31
34
|
# aren't needed for all of the test code. Only possible with some versions of Gherkin.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "#{File.dirname(__FILE__)}/../spec_helper"
|
2
|
+
|
3
|
+
|
4
|
+
describe 'the gem' do
|
5
|
+
|
6
|
+
let(:gemspec) { eval(File.read "#{File.dirname(__FILE__)}/../../../../cuke_modeler.gemspec") }
|
7
|
+
|
8
|
+
|
9
|
+
it 'validates cleanly' do
|
10
|
+
mock_ui = Gem::MockGemUi.new
|
11
|
+
Gem::DefaultUserInteraction.use_ui(mock_ui) { gemspec.validate }
|
12
|
+
|
13
|
+
expect(mock_ui.error).to_not match(/warn/i)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
describe CukeModeler do
|
20
|
+
|
21
|
+
it "has a version number" do
|
22
|
+
expect(CukeModeler::VERSION).not_to be nil
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cuke_modeler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Kessler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gherkin
|
@@ -62,16 +62,16 @@ dependencies:
|
|
62
62
|
name: bundler
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - "<"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0'
|
67
|
+
version: '3.0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - "
|
72
|
+
- - "<"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '0'
|
74
|
+
version: '3.0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rake
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,6 +156,20 @@ dependencies:
|
|
156
156
|
- - "<"
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: 1.0.0
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: rainbow
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - "<"
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 4.0.0
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - "<"
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: 4.0.0
|
159
173
|
description: This gem facilitates modeling a test suite that is written in Gherkin
|
160
174
|
(e.g. Cucumber, SpecFlow, Lettuce, etc.). It does this by providing an abstraction
|
161
175
|
layer on top of the Abstract Syntax Tree that the 'gherkin' gem generates when parsing
|
@@ -171,8 +185,8 @@ files:
|
|
171
185
|
- ".gitignore"
|
172
186
|
- ".simplecov"
|
173
187
|
- ".travis.yml"
|
188
|
+
- CHANGELOG.md
|
174
189
|
- Gemfile
|
175
|
-
- History.md
|
176
190
|
- LICENSE.txt
|
177
191
|
- README.md
|
178
192
|
- Rakefile
|
@@ -259,46 +273,50 @@ files:
|
|
259
273
|
- testing/gemfiles/gherkin4.gemfile
|
260
274
|
- testing/gemfiles/gherkin5.gemfile
|
261
275
|
- testing/gemfiles/gherkin6.gemfile
|
262
|
-
- testing/rspec/spec/integration/
|
263
|
-
- testing/rspec/spec/integration/
|
264
|
-
- testing/rspec/spec/integration/
|
265
|
-
- testing/rspec/spec/integration/
|
266
|
-
- testing/rspec/spec/integration/
|
267
|
-
- testing/rspec/spec/integration/
|
268
|
-
- testing/rspec/spec/integration/
|
269
|
-
- testing/rspec/spec/integration/
|
270
|
-
- testing/rspec/spec/integration/
|
271
|
-
- testing/rspec/spec/integration/
|
272
|
-
- testing/rspec/spec/integration/
|
273
|
-
- testing/rspec/spec/integration/
|
274
|
-
- testing/rspec/spec/integration/model_integration_spec.rb
|
276
|
+
- testing/rspec/spec/integration/adapters/gherkin_2_adapter_spec.rb
|
277
|
+
- testing/rspec/spec/integration/adapters/gherkin_3_adapter_spec.rb
|
278
|
+
- testing/rspec/spec/integration/adapters/gherkin_4_adapter_spec.rb
|
279
|
+
- testing/rspec/spec/integration/adapters/gherkin_6_adapter_spec.rb
|
280
|
+
- testing/rspec/spec/integration/models/background_integration_spec.rb
|
281
|
+
- testing/rspec/spec/integration/models/cell_integration_spec.rb
|
282
|
+
- testing/rspec/spec/integration/models/comment_integration_spec.rb
|
283
|
+
- testing/rspec/spec/integration/models/directory_integration_spec.rb
|
284
|
+
- testing/rspec/spec/integration/models/doc_string_integration_spec.rb
|
285
|
+
- testing/rspec/spec/integration/models/example_integration_spec.rb
|
286
|
+
- testing/rspec/spec/integration/models/feature_file_integration_spec.rb
|
287
|
+
- testing/rspec/spec/integration/models/feature_integration_spec.rb
|
288
|
+
- testing/rspec/spec/integration/models/model_integration_spec.rb
|
289
|
+
- testing/rspec/spec/integration/models/outline_integration_spec.rb
|
290
|
+
- testing/rspec/spec/integration/models/row_integration_spec.rb
|
291
|
+
- testing/rspec/spec/integration/models/scenario_integration_spec.rb
|
292
|
+
- testing/rspec/spec/integration/models/step_integration_spec.rb
|
293
|
+
- testing/rspec/spec/integration/models/table_integration_spec.rb
|
294
|
+
- testing/rspec/spec/integration/models/tag_integration_spec.rb
|
275
295
|
- testing/rspec/spec/integration/nested_integration_spec.rb
|
276
|
-
- testing/rspec/spec/integration/outline_integration_spec.rb
|
277
296
|
- testing/rspec/spec/integration/parsing_integration_spec.rb
|
278
|
-
- testing/rspec/spec/integration/row_integration_spec.rb
|
279
|
-
- testing/rspec/spec/integration/scenario_integration_spec.rb
|
280
297
|
- testing/rspec/spec/integration/shared/models_integration_specs.rb
|
281
|
-
- testing/rspec/spec/integration/step_integration_spec.rb
|
282
|
-
- testing/rspec/spec/integration/table_integration_spec.rb
|
283
|
-
- testing/rspec/spec/integration/tag_integration_spec.rb
|
284
298
|
- testing/rspec/spec/spec_helper.rb
|
285
|
-
- testing/rspec/spec/unit/
|
286
|
-
- testing/rspec/spec/unit/cell_unit_spec.rb
|
287
|
-
- testing/rspec/spec/unit/comment_unit_spec.rb
|
299
|
+
- testing/rspec/spec/unit/cuke_modeler_unit_spec.rb
|
288
300
|
- testing/rspec/spec/unit/described_unit_spec.rb
|
289
|
-
- testing/rspec/spec/unit/
|
290
|
-
- testing/rspec/spec/unit/
|
291
|
-
- testing/rspec/spec/unit/
|
292
|
-
- testing/rspec/spec/unit/
|
293
|
-
- testing/rspec/spec/unit/
|
294
|
-
- testing/rspec/spec/unit/
|
301
|
+
- testing/rspec/spec/unit/models/background_unit_spec.rb
|
302
|
+
- testing/rspec/spec/unit/models/cell_unit_spec.rb
|
303
|
+
- testing/rspec/spec/unit/models/comment_unit_spec.rb
|
304
|
+
- testing/rspec/spec/unit/models/directory_unit_spec.rb
|
305
|
+
- testing/rspec/spec/unit/models/doc_string_unit_spec.rb
|
306
|
+
- testing/rspec/spec/unit/models/example_unit_spec.rb
|
307
|
+
- testing/rspec/spec/unit/models/feature_file_unit_spec.rb
|
308
|
+
- testing/rspec/spec/unit/models/feature_unit_spec.rb
|
309
|
+
- testing/rspec/spec/unit/models/model_unit_spec.rb
|
310
|
+
- testing/rspec/spec/unit/models/outline_unit_spec.rb
|
311
|
+
- testing/rspec/spec/unit/models/row_unit_spec.rb
|
312
|
+
- testing/rspec/spec/unit/models/scenario_unit_spec.rb
|
313
|
+
- testing/rspec/spec/unit/models/step_unit_spec.rb
|
314
|
+
- testing/rspec/spec/unit/models/table_unit_spec.rb
|
315
|
+
- testing/rspec/spec/unit/models/tag_unit_spec.rb
|
295
316
|
- testing/rspec/spec/unit/named_unit_spec.rb
|
296
317
|
- testing/rspec/spec/unit/nested_unit_spec.rb
|
297
|
-
- testing/rspec/spec/unit/outline_unit_spec.rb
|
298
318
|
- testing/rspec/spec/unit/parsed_unit_spec.rb
|
299
319
|
- testing/rspec/spec/unit/parsing_unit_spec.rb
|
300
|
-
- testing/rspec/spec/unit/row_unit_spec.rb
|
301
|
-
- testing/rspec/spec/unit/scenario_unit_spec.rb
|
302
320
|
- testing/rspec/spec/unit/shared/bare_bones_models_unit_specs.rb
|
303
321
|
- testing/rspec/spec/unit/shared/containing_models_unit_specs.rb
|
304
322
|
- testing/rspec/spec/unit/shared/described_models_unit_specs.rb
|
@@ -313,10 +331,7 @@ files:
|
|
313
331
|
- testing/rspec/spec/unit/shared/stringifiable_models_unit_specs.rb
|
314
332
|
- testing/rspec/spec/unit/shared/tagged_models_unit_specs.rb
|
315
333
|
- testing/rspec/spec/unit/sourceable_unit_spec.rb
|
316
|
-
- testing/rspec/spec/unit/step_unit_spec.rb
|
317
334
|
- testing/rspec/spec/unit/stepped_unit_spec.rb
|
318
|
-
- testing/rspec/spec/unit/table_unit_spec.rb
|
319
|
-
- testing/rspec/spec/unit/tag_unit_spec.rb
|
320
335
|
- testing/rspec/spec/unit/taggable_unit_spec.rb
|
321
336
|
- testing/test_languages.json
|
322
337
|
- todo.txt
|
@@ -332,7 +347,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
332
347
|
requirements:
|
333
348
|
- - ">="
|
334
349
|
- !ruby/object:Gem::Version
|
335
|
-
version:
|
350
|
+
version: 1.8.7
|
351
|
+
- - "<"
|
352
|
+
- !ruby/object:Gem::Version
|
353
|
+
version: '3.0'
|
336
354
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
337
355
|
requirements:
|
338
356
|
- - ">="
|