cucumber-core 10.0.1 → 10.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f43f47dbb935621c716f72ba221a08f681e455e42a0cef8ee252179ebcf21f39
4
- data.tar.gz: 6bc6a8eee45a5ca63f79b8b6ab51afd54b225ee6e8e99e4fd52f3cce115ab72c
3
+ metadata.gz: 3fa23ea0ab7cadc890208606240c643188a9f42adc93586638893bb49b286e88
4
+ data.tar.gz: f3db07124c84ce1fbbb4c37f161973368bd9b1bfde30e43f4dcd2c70d6b093b5
5
5
  SHA512:
6
- metadata.gz: c74bd395c4d266f95f82837c495280a9bb2221630dd0beebd951a6d6f036388936d83942d785fe4a88a5bd1c536571ab3dbe232dc28ae468b7584a1a3bb6e240
7
- data.tar.gz: a0bbaf6a94c43aa7e770a68ae06e4ff0543b75296f675eca017ba017066622c640ec35daf86008ee1a5cf958f28d157fcf226dd4cbb9187ec51a957da7df5e6f
6
+ metadata.gz: 2675a16b7350a9a035034a1d4789d5ff3b3679053a07539b357b5528cf169199afcf053ebf7299ddc2829bf86cd03efc8947d4ec466d3eb1bf89c460f717fa79
7
+ data.tar.gz: 4daab00478626f036dacd184578982a1a9a8bda8b54bdd47334bd91869c996157a62b8c58f0a39a06ca8d90f24d9da5d78ab99a68e977e7329b214397553820d
data/CHANGELOG.md CHANGED
@@ -14,6 +14,11 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
14
14
 
15
15
  ### Dependencies
16
16
 
17
+ ## [10.1.0](https://github.com/cucumber/cucumber-ruby-core/compare/v10.0.1...v10.1.0)
18
+
19
+ ### Dependencies
20
+
21
+ * Patched `cucumber-gherkin`, `cucumber-messages` and `cucumber-tag-expressions`
17
22
 
18
23
  ## [10.0.1](https://github.com/cucumber/cucumber-ruby-core/compare/v10.0.0...v10.0.1)
19
24
 
data/CONTRIBUTING.md CHANGED
@@ -1,13 +1,186 @@
1
- Release Process
2
- ===============
1
+ # Contributing to Cucumber Ruby Core
3
2
 
4
- * Upgrade gems with `scripts/update-gemspec`
5
- * Bump the version number in `lib/cucumber/core/version.rb`
6
- * Update `CHANGELOG.md` with the upcoming version number and create a new `In Git` section
7
- * Remove empty sections from `CHANGELOG.md`
8
- * Now release it:
3
+ Thank you for considering contributing to Cucumber!
9
4
 
5
+ If you are not sure your contribution is related to `cucumber-ruby-core`, please
6
+ consider taking a look at [`cucumber-ruby`'s CONTRIBUTING.md](https://github.com/cucumber/cucumber-ruby/blob/main/CONTRIBUTING.md) first.
7
+
8
+ ## Code of Conduct
9
+
10
+ Everyone interacting in this codebase and issue tracker is expected to follow
11
+ the Cucumber [code of conduct](https://cucumber.io/conduct).
12
+
13
+ ## How can I contribute?
14
+
15
+ If you just want to know how to contribute to the code of `cucumber-ruby-core`,
16
+ go to [Contribute to the code](#contribute-to-the-code).
17
+
18
+ ## Report bugs and submit feature requests
19
+
20
+ The short version is:
21
+
22
+ - Try to check there is not already an issue or pull request that deals with
23
+ your bug or request
24
+ - Explain your issue and include as much details as possible to help other
25
+ people reproduce your problem or understand your request
26
+ - Consider submitting a pull request if you feel confident enough
27
+
28
+ You can find more details for each of these steps in the following sections.
29
+
30
+ ### Look for existing issues and pull requests
31
+
32
+ Search in [the current repository][cucumber-ruby-core-issues], in the
33
+ [mono-repo][cucumber/common-issues], but also in the
34
+ [whole cucumber organization][cucumber-issues] if the problem or feature has already
35
+ been reported. If you find an issue or pull request which is still open, add
36
+ comments to it instead of opening a new one.
37
+
38
+ If you're not sure, don't hesitate to just open a new issue. We can always merge
39
+ and de-duplicate later.
40
+
41
+ ### Submitting a pull request
42
+
43
+ When submitting a pull request:
44
+
45
+ - create a [draft pull request][how-to-create-a-draft-pr]
46
+ - try to follow the instructions in the [template](.github/PULL_REQUEST_TEMPLATE.md)
47
+ - if possible, [sign your commits]
48
+ - update CHANGELOG.md with your changes
49
+ - once the PR is ready, request for reviews
50
+
51
+ More info on [how to contribute to the code](#contribute-to-the-code) can be
52
+ found below.
53
+
54
+ ### Opening a new issue
55
+
56
+ To open a good issue, be clear and precise.
57
+
58
+ If you report a problem, the reader must be able to reproduce it easily.
59
+ Please do your best to create a [minimal, reproducible example][minimal-reproducible-example].
60
+
61
+ Consider submitting a pull request. Even if you think you cannot fix it by
62
+ yourself, a pull request with a failing test is always welcome.
63
+
64
+ If your request is for an enhancement - a new feature - try to be specific and
65
+ support your request with referenced facts and include examples to illustrate
66
+ your proposal.
67
+
68
+ ## Contribute to the code
69
+
70
+ ### Development environment
71
+
72
+ Development environment for `cucumber-ruby-core` is a simple Ruby environment with
73
+ Bundler. Use a [supported Ruby version](./README.md#supported-platforms), make
74
+ sure [Bundler] is set-up, and voilà!
75
+
76
+ You can then [fork][how-to-fork] and clone the repository. If your environment
77
+ is set-up properly, the following commands should install the dependencies and
78
+ execute all the tests successfully.
79
+
80
+ ```shell
81
+ bundle install
82
+ bundle exec rake
10
83
  ```
11
- git commit -m "Release X.Y.Z"
12
- make release
84
+
85
+ You can now create a branch for your changes and [submit a pull request](#submitting-a-pull-request)!
86
+
87
+ ### Working with local cucumber dependencies
88
+
89
+ You may need to use local dependencies instead of released gems for `cucumber-gherkin`
90
+ or `cucumber-messages`. To do so the [`Gemfile`](./Gemfile) for `cucumber-core`
91
+ allows you to specify a local path for your gems using environment variables:
92
+
93
+ CUCUMBER_GHERKIN_RUBY
94
+ CUCUMBER_MESSAGES_RUBY
95
+
96
+ For example, the following would use a local version of `cucumber-gherkin` with
97
+ the `rake` command:
98
+
99
+ ```shell
100
+ CUCUMBER_GHERKIN_RUBY=../common/gherkin/ruby bundle exec rake
13
101
  ```
102
+
103
+ In the same way, if you want to test your changes to `cucumber-core` with a local
104
+ `cucumber-ruby`, checkout [`cucumber-ruby`][cucumber-ruby] and do your tests with
105
+ `CUCUMBER_RUBY_CORE` pointing to your local `cucumber-core`:
106
+
107
+ ```shell
108
+ ~/cucumber-ruby-core> cd ../cucumber-ruby
109
+ ~/cucumber-ruby> CUCUMBER_RUBY_CORE=../cucumber-ruby-core bundle exec rake
110
+ ```
111
+
112
+ ### Using a local Gemfile
113
+
114
+ A local Gemfile allows you to use your prefer set of gems for your own
115
+ development workflow, like gems dedicated to debugging. Such gems are not part
116
+ of `cucumber-ruby` standard `Gemfile`.
117
+
118
+ `Gemfile.local`, `Gemfile.local.lock` and `.bundle` have been added to
119
+ `.gitignore` so local changes cannot be accidentaly commited and pushed to the
120
+ repository.
121
+
122
+ A `Gemfile.local` may look like this:
123
+
124
+ ```ruby
125
+ # Gemfile.local
126
+
127
+ # Include the regular Gemfile
128
+ eval File.read('Gemfile')
129
+
130
+ # Include your favorites development gems
131
+ group :development do
132
+ gem 'byebug'
133
+ gem 'pry'
134
+ gem 'pry-byebug'
135
+
136
+ gem 'debase', require: false
137
+ gem 'ruby-debug-ide', require: false
138
+ end
139
+ ```
140
+
141
+ Then you can execute bundler with the `--gemfile` flag:
142
+ `bundle install --gemfile Gemfile.local`, or with an environment variable:
143
+ `BUNDLE_GEMFILE=Gemfile.local bundle [COMMAND]`.
144
+
145
+ To use your local Gemfile per default, you can also execute
146
+ `bundle config set --local gemfile Gemfile.local`.
147
+
148
+ ### First timer? Welcome!
149
+
150
+ Looking for something simple to begin with? Look at issues with the label
151
+ '[good first issue](https://github.com/cucumber/cucumber-ruby-core/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)'.
152
+
153
+ ### Having trouble getting started with the code? We're here to help!
154
+
155
+ If you have trouble setting-up your development environment, or getting started
156
+ with the code, you can join us on [Slack][community-slack]. You will find there
157
+ a lot of contributors.
158
+
159
+ Full-time maintainers are also available. We would be please to have 1:1 pairing
160
+ sessions to help you getting started. Look for
161
+ [Matt Wynne](https://cucumberbdd.slack.com/team/U590XDLF3) or
162
+ [Aurélien Reeves](https://cucumberbdd.slack.com/team/U011BB95MC7) on
163
+ [Slack][community-slack].
164
+
165
+ ### Additional documentation and notice
166
+
167
+ You can find additional documentation in the [docs](./docs) directory such as
168
+ (non-exhaustive list):
169
+
170
+ - [How to release cucumber-ruby-core](./docs/RELEASE_PROCESS.md) (for maintainers)
171
+ - [Overview of cucumber-ruby-core](./docs/ARCHITECTURE.md)
172
+
173
+ <!-- Links -->
174
+
175
+ [community-slack]: https://cucumberbdd.slack.com/
176
+ [cucumber/common]: https://github.com/cucumber/common
177
+ [cucumber-ruby]: https://github.com/cucumber/cucumber-ruby
178
+ [cucumber-ruby-core]: https://github.com/cucumber/cucumber-ruby-core
179
+ [cucumber-ruby-core-issues]: https://github.com/cucumber/cucumber-ruby-core/search?q=is%3Aissue
180
+ [cucumber/common-issues]: https://github.com/cucumber/common/search?q=is%3Aissue
181
+ [cucumber-issues]: https://github.com/search?q=is%3Aissue+user%3Acucumber
182
+ [how-to-create-a-draft-pr]: https://docs.github.com/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests
183
+ [how-to-fork]: https://docs.github.com/github/collaborating-with-pull-requests/working-with-forks/about-forks
184
+ [sign your commits]: https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification/signing-commits
185
+ [minimal-reproducible-example]: https://stackoverflow.com/help/minimal-reproducible-example
186
+ [Bundler]: https://bundler.io/
data/README.md CHANGED
@@ -1,123 +1,128 @@
1
- # cucumber-core
1
+ <p align="center">
2
+ <img src="./.github/img/cucumber-open-logo.png" alt="Cucumber Open - Supported by Smartbear" width="428" />
3
+ </p>
2
4
 
3
- [![CircleCI](https://circleci.com/gh/cucumber/cucumber-ruby-core.svg?style=svg)](https://circleci.com/gh/cucumber/cucumber-ruby-core)
4
- [![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby-core.svg)](https://codeclimate.com/github/cucumber/cucumber-ruby-core)
5
- [![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby-core/badge.svg?branch=master)](https://coveralls.io/r/cucumber/cucumber-ruby-core?branch=master)
5
+ # Cucumber
6
+
7
+ [![OpenCollective](https://opencollective.com/cucumber/backers/badge.svg)](https://opencollective.com/cucumber)
8
+ [![OpenCollective](https://opencollective.com/cucumber/sponsors/badge.svg)](https://opencollective.com/cucumber)
6
9
  [![pull requests](https://oselvar.com/api/badge?label=pull%20requests&csvUrl=https%3A%2F%2Fraw.githubusercontent.com%2Fcucumber%2Foselvar-github-metrics%2Fmain%2Fdata%2Fcucumber%2Fcucumber-ruby-core%2FpullRequests.csv)](https://oselvar.com/github/cucumber/oselvar-github-metrics/main/cucumber/cucumber-ruby-core)
7
10
  [![issues](https://oselvar.com/api/badge?label=issues&csvUrl=https%3A%2F%2Fraw.githubusercontent.com%2Fcucumber%2Foselvar-github-metrics%2Fmain%2Fdata%2Fcucumber%2Fcucumber-ruby-core%2Fissues.csv)](https://oselvar.com/github/cucumber/oselvar-github-metrics/main/cucumber/cucumber-ruby-core)
11
+ [![Test cucumber-core](https://github.com/cucumber/cucumber-ruby-core/actions/workflows/cucumber-ruby-core.yml/badge.svg)](https://github.com/cucumber/cucumber-ruby-core/actions/workflows/cucumber-ruby-core.yml)
12
+ [![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby-core.svg)](https://codeclimate.com/github/cucumber/cucumber-ruby-core)
13
+ [![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby-core/badge.svg?branch=main)](https://coveralls.io/r/cucumber/cucumber-ruby-core?branch=main)
8
14
 
9
- Cucumber Core is the [inner hexagon](http://alistair.cockburn.us/Hexagonal+architecture) for the [Ruby flavour of Cucumber](https://github.com/cucumber/cucumber-ruby).
10
-
11
- It contains the core domain logic to execute Cucumber features. It has no user interface, just a Ruby API. If you're interested in how Cucumber works, or in building other tools that work with Gherkin documents, you've come to the right place.
12
-
13
- ## An overview
14
-
15
- The entry-point is a single method on the module [`Cucumber::Core`](Cucumber/Core.html) called [`#execute`](Cucumber/Core.html#execute-instance_method). Here's what it does:
16
-
17
- 1. Parses the plain-text Gherkin documents into an **AST**
18
- 2. Compiles the AST down to **test cases**
19
- 3. Passes the test cases through any **filters**
20
- 4. Executes the test cases, emitting **events** as it goes
21
-
22
- We've introduced a number of concepts here, so let's go through them in detail.
15
+ Cucumber is a tool for running automated tests written in plain language. Because they're
16
+ written in plain language, they can be read by anyone on your team. Because they can be
17
+ read by anyone, you can use them to help improve communication, collaboration and trust on
18
+ your team.
23
19
 
24
- ### The AST
20
+ <p align="center">
21
+ <img src="./.github/img/gherkin-example.png" alt="Cucumber Gherkin Example" width="728" />
22
+ </p>
25
23
 
26
- The Abstract Syntax Tree or [AST](Cucumber/Core/Ast.html) is an object graph that represents the Gherkin documents you've passed into the core. Things like [Feature](Cucumber/Core/Ast/Feature.html), [Scenario](Cucumber/Core/Ast/Scenario.html) and [ExamplesTable](Cucumber/Core/Ast/ExamplesTable.html).
24
+ Cucumber Core is the [inner hexagon](https://en.wikipedia.org/wiki/Hexagonal_architecture_(software))
25
+ for the [Ruby flavour of Cucumber](https://github.com/cucumber/cucumber-ruby).
27
26
 
28
- These are immutable value objects.
27
+ It contains the core domain logic to execute Cucumber features. It has no user interface,
28
+ just a Ruby API. If you're interested in how Cucumber works, or in building other
29
+ tools that work with Gherkin documents, you've come to the right place.
29
30
 
30
- ### Test cases
31
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for info on contributing to Cucumber (issues,
32
+ PRs, etc.).
31
33
 
32
- Your gherkin might contain scenarios, as well as examples from tables beneath a scenario outline.
34
+ Everyone interacting in this codebase and issue tracker is expected to follow the
35
+ Cucumber [code of conduct](https://cucumber.io/conduct).
33
36
 
34
- Test cases represent the general case of both of these. We compile the AST down to instances of [`Cucumber::Core::Test::Case`](Cucumber/Core/Test/Case.html), each containing a number of instances of [`Cucumber::Core::Test::Step`](Cucumber/Core/Test/Step.html). It's these that are then filtered and executed.
37
+ ## Installation
35
38
 
36
- Test cases and their test steps are also immutable value objects.
39
+ `cucumber-core` is a Ruby gem. Install it as you would install any gem: add
40
+ `cucumber-core` to your Gemfile:
37
41
 
38
- ### Filters
42
+ gem 'cucumber-core'
39
43
 
40
- Once we have the test cases, and they've been activated by the mappings, you may want to pass them through a filter or two. Filters can be used to do things like activate, sort, replace or remove some of the test cases or their steps before they're executed.
44
+ then install it:
41
45
 
42
- ### Events
46
+ $ bundle
43
47
 
44
- Events are how you find out what is happening during your test run. As the test cases and steps are executed, the runner emits events to signal what's going on.
48
+ or install the gem directly:
45
49
 
46
- The following events are emitted during a run:
50
+ $ gem install cucumber-core
47
51
 
48
- - [`TestCaseStarting`](Cucumber/Core/Events/TestCaseStarting.html)
49
- - [`TestStepStarting`](Cucumber/Core/Events/TestStepStarting.html)
50
- - [`TestStepFinished`](Cucumber/Core/Events/TestStepFinished.html)
51
- - [`TestCaseFinished`](Cucumber/Core/Events/TestCaseFinished.html)
52
+ ### Supported platforms
52
53
 
53
- That's probably best illustrated with an example.
54
+ - Ruby 3.0
55
+ - Ruby 2.7
56
+ - Ruby 2.6
57
+ - Ruby 2.5
58
+ - Ruby 2.4
59
+ - Ruby 2.3
60
+ - JRuby 9.2 (with [some limitations](https://github.com/cucumber/cucumber-ruby/blob/main/docs/jruby-limitations.md))
54
61
 
55
- ## Example
62
+ ## Usage
56
63
 
57
- Here's an example of how you might use [`Cucumber::Core#execute`](Cucumber/Core#execute-instance_method)
64
+ The following example aims to illustrate how to use `cucumber-core` gem and to
65
+ make sure it is working well within your environment. For more details
66
+ explanation on what it actually does and how to work with it, see
67
+ [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
58
68
 
59
69
  ```ruby
70
+ # cucumber_core_example.rb
71
+
60
72
  require 'cucumber/core'
61
73
  require 'cucumber/core/filter'
62
74
 
63
- # This is the most complex part of the example. The filter takes test cases as input,
64
- # activates each step with an action block, then passes a new test case with those activated
65
- # steps in it on to the next filter in the chain.
66
75
  class ActivateSteps < Cucumber::Core::Filter.new
67
76
  def test_case(test_case)
68
77
  test_steps = test_case.test_steps.map do |step|
69
- activate(step)
78
+ step.with_action { print "processing: " }
70
79
  end
71
80
 
72
81
  test_case.with_steps(test_steps).describe_to(receiver)
73
82
  end
74
-
75
- private
76
-
77
- def activate(step)
78
- case step.text
79
- when /fail/
80
- step.with_action { raise Failure }
81
- when /pass/
82
- step.with_action {}
83
- else
84
- step
85
- end
86
- end
87
83
  end
88
84
 
89
- # Create a Gherkin document to run
90
85
  feature = Cucumber::Core::Gherkin::Document.new(__FILE__, <<-GHERKIN)
91
86
  Feature:
92
87
  Scenario:
93
- Given passing
94
- And failing
95
- And undefined
88
+ Given some requirements
89
+ When we do something
90
+ Then it should pass
96
91
  GHERKIN
97
92
 
98
- # Create a runner class that uses the Core's DSL
99
93
  class MyRunner
100
94
  include Cucumber::Core
101
95
  end
102
96
 
103
- # Now execute the feature, using the filter we built, and subscribing to
104
- # an event so we can print the output.
105
97
  MyRunner.new.execute([feature], [ActivateSteps.new]) do |events|
106
98
  events.on(:test_step_finished) do |event|
107
99
  test_step, result = event.test_step, event.result
108
- puts "#{test_step.text} #{result}"
100
+ print "#{test_step.text} #{result}\n"
109
101
  end
110
102
  end
111
103
  ```
112
104
 
113
- If you run this little Ruby script, you should see the following output:
105
+ If you run this Ruby script:
114
106
 
107
+ ```shell
108
+ ruby cucumber_core_example.rb
115
109
  ```
116
- passing ✓
117
- failing
118
- undefined ?
110
+
111
+ You should see the following output:
112
+
113
+ ```
114
+ processing: some requirements ✓
115
+ processing: we do something ✓
116
+ processing: it should pass ✓
119
117
  ```
120
118
 
119
+ ## Documentation and support
120
+
121
+ - Getting started with Cucumber, writing features, step definitions, and more: https://cucumber.io/docs
122
+ - Slack: [register for an account](https://cucumberbdd-slack-invite.herokuapp.com/) then head over to [#intro](https://cucumberbdd.slack.com/messages/C5WD8SA21/)
123
+ - `cucumber-core` overview: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
124
+ - How to work with local repositories for `cucumber-gherkin`, `cucumber-messages` or `cucumber-ruby`: [CONTRIBUTING.md#working-with-local-cucumber-dependencies](./CONTRIBUTING.md#working-with-local-cucumber-dependencies)
125
+
121
126
  ## Copyright
122
127
 
123
- Copyright (c) Cucumber Limited.
128
+ Copyright (c) Cucumber Ltd. and Contributors. See LICENSE for details.
@@ -19,7 +19,7 @@ module Cucumber
19
19
  end
20
20
 
21
21
  def sec
22
- nsec / 10**9.0
22
+ nsec / (10**9.0)
23
23
  end
24
24
 
25
25
  private
@@ -42,7 +42,7 @@ module Cucumber
42
42
  else
43
43
  def time_in_nanoseconds
44
44
  t = Time.now
45
- t.to_i * 10**9 + t.nsec
45
+ (t.to_i * (10**9)) + t.nsec
46
46
  end
47
47
  end
48
48
  end
@@ -3,7 +3,7 @@ module Cucumber
3
3
  module Core
4
4
  class Version
5
5
  def self.to_s
6
- "10.0.1"
6
+ "10.1.0"
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- # -*- coding: utf-8 -*-
3
2
  require 'cucumber/core'
4
3
  require 'cucumber/core/gherkin/writer'
5
4
  require 'cucumber/core/platform'
@@ -25,7 +24,7 @@ module Cucumber
25
24
  it "describes itself to a visitor" do
26
25
  visitor = double
27
26
  args = double
28
- expect( visitor ).to receive(:test_case).with(test_case, args)
27
+ expect(visitor).to receive(:test_case).with(test_case, args)
29
28
  test_case.describe_to(visitor, args)
30
29
  end
31
30
 
@@ -33,68 +32,68 @@ module Cucumber
33
32
  visitor = double
34
33
  args = double
35
34
  test_steps.each do |test_step|
36
- expect( test_step ).to receive(:describe_to).with(visitor, args)
35
+ expect(test_step).to receive(:describe_to).with(visitor, args)
37
36
  end
38
- allow( visitor ).to receive(:test_case).and_yield(visitor)
37
+ allow(visitor).to receive(:test_case).and_yield(visitor)
39
38
  test_case.describe_to(visitor, args)
40
39
  end
41
40
 
42
41
  it "describes around hooks in order" do
43
42
  visitor = double
44
- allow( visitor ).to receive(:test_case).and_yield(visitor)
45
- first_hook, second_hook = double, double
46
- expect( first_hook ).to receive(:describe_to).ordered.and_yield
47
- expect( second_hook ).to receive(:describe_to).ordered.and_yield
43
+ allow(visitor).to receive(:test_case).and_yield(visitor)
44
+ first_hook = double
45
+ second_hook = double
46
+ expect(first_hook).to receive(:describe_to).ordered.and_yield
47
+ expect(second_hook).to receive(:describe_to).ordered.and_yield
48
48
  around_hooks = [first_hook, second_hook]
49
49
  Test::Case.new(id, name, [], location, tags, language, around_hooks).describe_to(visitor, double)
50
50
  end
51
-
52
51
  end
53
52
 
54
53
  describe "#name" do
55
54
  it "the name is passed when creating the test case" do
56
- expect( test_case.name ).to eq(name)
55
+ expect(test_case.name).to eq(name)
57
56
  end
58
57
  end
59
58
 
60
59
  describe "#location" do
61
60
  it "the location is passed when creating the test case" do
62
- expect( test_case.location ).to eq(location)
61
+ expect(test_case.location).to eq(location)
63
62
  end
64
63
  end
65
64
 
66
65
  describe "#tags" do
67
66
  it "the tags are passed when creating the test case" do
68
- expect( test_case.tags ).to eq(tags)
67
+ expect(test_case.tags).to eq(tags)
69
68
  end
70
69
  end
71
70
 
72
71
  describe "matching tags" do
73
72
  let(:tags) { ['@a', '@b', '@c'].map { |value| Tag.new(location, value) } }
74
73
  it "matches tags using tag expressions" do
75
- expect( test_case.match_tags?(['@a and @b']) ).to be_truthy
76
- expect( test_case.match_tags?(['@a or @d']) ).to be_truthy
77
- expect( test_case.match_tags?(['not @d']) ).to be_truthy
78
- expect( test_case.match_tags?(['@a and @d']) ).to be_falsy
74
+ expect(test_case.match_tags?(['@a and @b'])).to be_truthy
75
+ expect(test_case.match_tags?(['@a or @d'])).to be_truthy
76
+ expect(test_case.match_tags?(['not @d'])).to be_truthy
77
+ expect(test_case.match_tags?(['@a and @d'])).to be_falsy
79
78
  end
80
79
 
81
80
  it "matches handles multiple expressions" do
82
- expect( test_case.match_tags?(['@a and @b', 'not @d']) ).to be_truthy
83
- expect( test_case.match_tags?(['@a and @b', 'not @c']) ).to be_falsy
81
+ expect(test_case.match_tags?(['@a and @b', 'not @d'])).to be_truthy
82
+ expect(test_case.match_tags?(['@a and @b', 'not @c'])).to be_falsy
84
83
  end
85
84
  end
86
85
 
87
86
  describe "matching names" do
88
87
  let(:name) { 'scenario' }
89
88
  it "matches names against regexp" do
90
- expect( test_case.match_name?(/scenario/) ).to be_truthy
89
+ expect(test_case.match_name?(/scenario/)).to be_truthy
91
90
  end
92
91
  end
93
92
 
94
93
  describe "#language" do
95
94
  let(:language) { 'en-pirate' }
96
95
  it "the language is passed when creating the test case" do
97
- expect( test_case.language ).to eq 'en-pirate'
96
+ expect(test_case.language).to eq 'en-pirate'
98
97
  end
99
98
  end
100
99
 
@@ -120,7 +119,6 @@ module Cucumber
120
119
  expect(test_case_instances[0]).not_to equal test_case_instances[1]
121
120
  end
122
121
  end
123
-
124
122
  end
125
123
  end
126
124
  end
@@ -232,14 +232,14 @@ module Cucumber::Core
232
232
  let(:locations) do
233
233
  (1..num_locations).map do |i|
234
234
  (1..num_scenarios_per_feature).map do |j|
235
- line = 3 + (j - 1) * 3
235
+ line = 3 + ((j - 1) * 3)
236
236
  Test::Location.new("features/test_#{i}.feature", line)
237
237
  end
238
238
  end.flatten
239
239
  end
240
240
 
241
241
  max_duration_ms = 10000
242
- max_duration_ms = max_duration_ms * 2.5 if defined?(JRUBY_VERSION)
242
+ max_duration_ms *= 2.5 if defined?(JRUBY_VERSION)
243
243
  it "filters #{num_features * num_scenarios_per_feature} test cases within #{max_duration_ms}ms" do
244
244
  filter = Test::LocationsFilter.new(locations)
245
245
  Timeout.timeout(max_duration_ms / 1000.0) do
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: 10.0.1
4
+ version: 10.1.0
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: 2021-07-19 00:00:00.000000000 Z
15
+ date: 2021-10-11 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: cucumber-gherkin
@@ -20,60 +20,60 @@ dependencies:
20
20
  requirements:
21
21
  - - "~>"
22
22
  - !ruby/object:Gem::Version
23
- version: '20.0'
23
+ version: '22.0'
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 20.0.1
26
+ version: 22.0.0
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: '20.0'
33
+ version: '22.0'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 20.0.1
36
+ version: 22.0.0
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: cucumber-messages
39
39
  requirement: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: '17.0'
43
+ version: '17.1'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 17.0.1
46
+ version: 17.1.1
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '17.0'
53
+ version: '17.1'
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 17.0.1
56
+ version: 17.1.1
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: cucumber-tag-expressions
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '3.0'
63
+ version: '4.0'
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
- version: 3.0.1
66
+ version: 4.0.2
67
67
  type: :runtime
68
68
  prerelease: false
69
69
  version_requirements: !ruby/object:Gem::Requirement
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '3.0'
73
+ version: '4.0'
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: 3.0.1
76
+ version: 4.0.2
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: coveralls
79
79
  requirement: !ruby/object:Gem::Requirement
@@ -140,20 +140,20 @@ dependencies:
140
140
  requirements:
141
141
  - - "~>"
142
142
  - !ruby/object:Gem::Version
143
- version: '1.18'
143
+ version: '1.22'
144
144
  - - ">="
145
145
  - !ruby/object:Gem::Version
146
- version: 1.18.3
146
+ version: 1.22.1
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: '1.18'
153
+ version: '1.22'
154
154
  - - ">="
155
155
  - !ruby/object:Gem::Version
156
- version: 1.18.3
156
+ version: 1.22.1
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: rubocop-packaging
159
159
  requirement: !ruby/object:Gem::Requirement
@@ -284,27 +284,27 @@ requirements: []
284
284
  rubygems_version: 3.1.2
285
285
  signing_key:
286
286
  specification_version: 4
287
- summary: cucumber-core-10.0.1
287
+ summary: cucumber-core-10.1.0
288
288
  test_files:
289
- - spec/cucumber/core_spec.rb
290
- - spec/cucumber/core/report/summary_spec.rb
291
- - spec/cucumber/core/compiler_spec.rb
292
- - spec/cucumber/core/gherkin/parser_spec.rb
293
- - spec/cucumber/core/gherkin/writer_spec.rb
294
- - spec/cucumber/core/event_bus_spec.rb
295
- - spec/cucumber/core/filter_spec.rb
296
- - spec/cucumber/core/test/timer_spec.rb
289
+ - spec/report_api_spy.rb
297
290
  - spec/cucumber/core/test/case_spec.rb
298
- - spec/cucumber/core/test/result_spec.rb
299
- - spec/cucumber/core/test/action_spec.rb
300
- - spec/cucumber/core/test/filters/locations_filter_spec.rb
301
- - spec/cucumber/core/test/runner_spec.rb
302
- - spec/cucumber/core/test/doc_string_spec.rb
303
291
  - spec/cucumber/core/test/location_spec.rb
304
292
  - spec/cucumber/core/test/duration_matcher.rb
305
- - spec/cucumber/core/test/data_table_spec.rb
293
+ - spec/cucumber/core/test/doc_string_spec.rb
294
+ - spec/cucumber/core/test/action_spec.rb
295
+ - spec/cucumber/core/test/filters/locations_filter_spec.rb
296
+ - spec/cucumber/core/test/result_spec.rb
306
297
  - spec/cucumber/core/test/step_spec.rb
298
+ - spec/cucumber/core/test/data_table_spec.rb
299
+ - spec/cucumber/core/test/timer_spec.rb
307
300
  - spec/cucumber/core/test/empty_multiline_argument_spec.rb
301
+ - spec/cucumber/core/test/runner_spec.rb
302
+ - spec/cucumber/core/compiler_spec.rb
303
+ - spec/cucumber/core/event_bus_spec.rb
304
+ - spec/cucumber/core/filter_spec.rb
305
+ - spec/cucumber/core/report/summary_spec.rb
306
+ - spec/cucumber/core/gherkin/parser_spec.rb
307
+ - spec/cucumber/core/gherkin/writer_spec.rb
308
308
  - spec/cucumber/core/event_spec.rb
309
- - spec/report_api_spy.rb
309
+ - spec/cucumber/core_spec.rb
310
310
  - spec/coverage.rb