cucumber-core 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -19
- data/README.md +1 -0
- data/lib/cucumber/core/gherkin/parser.rb +11 -2
- data/lib/cucumber/core/gherkin/writer.rb +30 -2
- data/lib/cucumber/core/version.rb +1 -1
- data/spec/capture_warnings.rb +1 -1
- data/spec/cucumber/core/gherkin/parser_spec.rb +51 -0
- data/spec/cucumber/core/test/location_spec.rb +5 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ab18c1635eeda0fbd575d01a83bafc96a0073a1ec0ba1249e4bf26b9c60f914
|
4
|
+
data.tar.gz: 1dccc021f15d75d76c2c3974049f768ee926e0dd7ced151cc9b46a2b422b6906
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81461cf45c9616e3e36fc70a25da1b3c0e30e709cc12e675994e6fd0f730ff4e68f9680453e31ecb4814d69a9a79a98ceeb0691a7365fc660fe9e4cad7462092
|
7
|
+
data.tar.gz: 3a8cc3c74351d91f90c36f509a813b56cab9a333057de9b3b596de4b1feaa8dc912d87827d2682f1fc3f2b2eca2f82c75f38bd2f75204119eb21bcbcf0b8507a
|
data/CHANGELOG.md
CHANGED
@@ -1,32 +1,16 @@
|
|
1
1
|
Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CONTRIBUTING.md) on how to contribute to Cucumber.
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [5.0.2](https://github.com/cucumber/cucumber-ruby-core/compare/v5.0.1...v5.0.2)
|
4
4
|
|
5
5
|
### Changed
|
6
6
|
|
7
|
-
*
|
8
|
-
|
9
|
-
### Added
|
10
|
-
|
11
|
-
* N/A
|
12
|
-
|
13
|
-
### Fixed
|
14
|
-
|
15
|
-
* N/A
|
16
|
-
|
17
|
-
### Removed
|
18
|
-
|
19
|
-
* N/A
|
20
|
-
|
21
|
-
### Improved
|
22
|
-
|
23
|
-
* N/A
|
7
|
+
* Update to use Gherkin v8
|
24
8
|
|
25
9
|
## [5.0.1](https://github.com/cucumber/cucumber-ruby-core/compare/v5.0.0...v5.0.1)
|
26
10
|
|
27
11
|
### Removed
|
28
12
|
|
29
|
-
* Remove support for ruby 2.2 and below. 2.3 or higher is required now.
|
13
|
+
* Remove support for ruby 2.2 and below. 2.3 or higher is required now.
|
30
14
|
|
31
15
|
## [5.0.0](https://github.com/cucumber/cucumber-ruby-core/compare/v4.0.0...v5.0.0)
|
32
16
|
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# cucumber-core
|
2
2
|
|
3
3
|
[![Chat with us](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cucumber/cucumber-ruby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
|
+
[![CircleCI](https://circleci.com/gh/cucumber/cucumber-ruby-core.svg?style=svg)](https://circleci.com/gh/cucumber/cucumber-ruby-core)
|
4
5
|
[![Build Status](https://travis-ci.org/cucumber/cucumber-ruby-core.svg?branch=master)](https://travis-ci.org/cucumber/cucumber-ruby-core)
|
5
6
|
[![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby-core.svg)](https://codeclimate.com/github/cucumber/cucumber-ruby-core)
|
6
7
|
[![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby-core/badge.svg?branch=master)](https://coveralls.io/r/cucumber/cucumber-ruby-core?branch=master)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'gherkin
|
2
|
+
require 'gherkin'
|
3
3
|
|
4
4
|
module Cucumber
|
5
5
|
module Core
|
@@ -16,7 +16,7 @@ module Cucumber
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def document(document)
|
19
|
-
messages = ::Gherkin
|
19
|
+
messages = ::Gherkin.from_source(document.uri, document.body, gherkin_options(document))
|
20
20
|
messages.each do |message|
|
21
21
|
if !message.gherkinDocument.nil?
|
22
22
|
event_bus.gherkin_source_parsed(message.gherkinDocument)
|
@@ -31,6 +31,15 @@ module Cucumber
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
def gherkin_options(document)
|
35
|
+
{
|
36
|
+
default_dialect: document.language,
|
37
|
+
include_source: false,
|
38
|
+
include_gherkin_document: true,
|
39
|
+
include_pickles: true
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
34
43
|
def done
|
35
44
|
receiver.done
|
36
45
|
self
|
@@ -48,7 +48,7 @@ module Cucumber
|
|
48
48
|
|
49
49
|
default_keyword 'Feature'
|
50
50
|
|
51
|
-
elements :background, :scenario, :scenario_outline
|
51
|
+
elements :background, :rule, :scenario, :scenario_outline
|
52
52
|
|
53
53
|
def build(source = [])
|
54
54
|
elements.inject(source + statements) { |acc, el| el.build(acc) + [NEW_LINE] }
|
@@ -85,7 +85,29 @@ module Cucumber
|
|
85
85
|
|
86
86
|
private
|
87
87
|
def statements
|
88
|
-
prepare_statements comments_statement,
|
88
|
+
prepare_statements comments_statement,
|
89
|
+
tag_statement,
|
90
|
+
name_statement,
|
91
|
+
description_statement
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
class Rule
|
96
|
+
include HasElements
|
97
|
+
include HasOptionsInitializer
|
98
|
+
include HasDescription
|
99
|
+
include Indentation.level 2
|
100
|
+
|
101
|
+
default_keyword 'Rule'
|
102
|
+
|
103
|
+
elements :example, :scenario
|
104
|
+
|
105
|
+
private
|
106
|
+
def statements
|
107
|
+
prepare_statements comments_statement,
|
108
|
+
name_statement,
|
109
|
+
description_statement,
|
110
|
+
NEW_LINE
|
89
111
|
end
|
90
112
|
end
|
91
113
|
|
@@ -108,6 +130,12 @@ module Cucumber
|
|
108
130
|
end
|
109
131
|
end
|
110
132
|
|
133
|
+
class Example < Scenario
|
134
|
+
include Indentation.level 4
|
135
|
+
|
136
|
+
default_keyword 'Example'
|
137
|
+
end
|
138
|
+
|
111
139
|
class ScenarioOutline
|
112
140
|
include HasElements
|
113
141
|
include HasOptionsInitializer
|
data/spec/capture_warnings.rb
CHANGED
@@ -6,7 +6,7 @@ module CaptureWarnings
|
|
6
6
|
def report_warnings(&block)
|
7
7
|
current_dir = Dir.pwd
|
8
8
|
warnings, errors = capture_error(&block).partition { |line| line.include?('warning') }
|
9
|
-
project_warnings, other_warnings = warnings.uniq.partition { |line| line.include?(current_dir) }
|
9
|
+
project_warnings, other_warnings = warnings.uniq.partition { |line| line.include?(current_dir) && !line.include?('/vendor/') }
|
10
10
|
|
11
11
|
if errors.any?
|
12
12
|
puts errors.join("\n")
|
@@ -89,6 +89,57 @@ module Cucumber
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
+
context "when scenario is inside a rule" do
|
93
|
+
source do
|
94
|
+
feature do
|
95
|
+
rule do
|
96
|
+
scenario name: "My scenario"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
it "passes on the pickle" do
|
102
|
+
expect( receiver ).to receive(:pickle)
|
103
|
+
parse
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
context "when example is inside a rule" do
|
108
|
+
source do
|
109
|
+
feature do
|
110
|
+
rule do
|
111
|
+
example name: "My example"
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
it "passes on the pickle" do
|
117
|
+
expect( receiver ).to receive(:pickle)
|
118
|
+
parse
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
context "when there are multiple rules and scenarios or examples" do
|
123
|
+
source do
|
124
|
+
feature do
|
125
|
+
rule description: "First rule" do
|
126
|
+
scenario name: "Do not talk about the fight club" do
|
127
|
+
step 'text'
|
128
|
+
end
|
129
|
+
end
|
130
|
+
rule description: "Second rule"do
|
131
|
+
example name: "Do not talk about the fight club" do
|
132
|
+
step 'text'
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
it "passes on the pickles" do
|
139
|
+
expect( receiver ).to receive(:pickle).twice
|
140
|
+
parse
|
141
|
+
end
|
142
|
+
end
|
92
143
|
end
|
93
144
|
end
|
94
145
|
end
|
@@ -100,14 +100,17 @@ module Cucumber::Core::Test
|
|
100
100
|
|
101
101
|
context "when the location is neither below pwd nor in an installed gem" do
|
102
102
|
it "use the absolute path to the file" do
|
103
|
-
|
103
|
+
# Use File.expand on expectation to ensure tests work on multiple platform.
|
104
|
+
# On Windows, it will return "C:/path/file.rb" as an absolute path while it will return "/path/file.rb" on Linux.
|
105
|
+
expect( Location.from_source_location("/path/file.rb", 1).file ).to eq File.expand_path("/path/file.rb")
|
104
106
|
end
|
105
107
|
end
|
106
108
|
end
|
107
109
|
|
108
110
|
describe "created from file-colon-line" do
|
109
111
|
it "handles also Windows paths" do
|
110
|
-
|
112
|
+
# Note: running this test on Windows will produce "c:/path/file.rb", but "c:\path\file.rb" on Linux.
|
113
|
+
expect( Location.from_file_colon_line("c:\\path\\file.rb:123").file ).to match(/c:(\\|\/)path(\\|\/)file.rb/)
|
111
114
|
end
|
112
115
|
end
|
113
116
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2019-
|
15
|
+
date: 2019-10-31 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: gherkin
|
@@ -20,20 +20,20 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - "~>"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '8.1'
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 8.1.1
|
27
27
|
type: :runtime
|
28
28
|
prerelease: false
|
29
29
|
version_requirements: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '8.1'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
36
|
+
version: 8.1.1
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: cucumber-tag_expressions
|
39
39
|
requirement: !ruby/object:Gem::Requirement
|
@@ -245,7 +245,7 @@ requirements: []
|
|
245
245
|
rubygems_version: 3.0.3
|
246
246
|
signing_key:
|
247
247
|
specification_version: 4
|
248
|
-
summary: cucumber-core-5.0.
|
248
|
+
summary: cucumber-core-5.0.2
|
249
249
|
test_files:
|
250
250
|
- spec/cucumber/core/test/runner_spec.rb
|
251
251
|
- spec/cucumber/core/test/doc_string_spec.rb
|