Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
- Updated `cucumber-expressions` to v20
- Updated `cucumber-html-formatter` to v24
- Permit `multi_test` v2/v3 so we can begin to remove some legacy support
- Updated `cucumber-core` to v19
- All events now inherit from the new `Cucumber::Core::Event::Base` class ([luke-hill](https://github.com/luke-hill))

### Removed
- Removed the concept of `strict` from cucumber-ruby ([luke-hill](https://github.com/luke-hill))
Expand All @@ -27,6 +29,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
logic and some old rspec helper files)
- Removed handling of a Ruby 2.1 system error ([luke-hill](https://github.com/luke-hill))
- Removed support for Ruby 3.1 and 3.2 (Minimum ruby is now 3.3) ([luke-hill](https://github.com/luke-hill))
- Removed the duplicated "new" base class for events - use `Core::Event::Base` instead ([luke-hill](https://github.com/luke-hill))

### Fixed
- Updated the `html-formatter` to access message stream correctly ([#1899](https://github.com/cucumber/cucumber-ruby/pull/1899)) [brasmusson](https://github.com/brasmusson)
Expand Down
2 changes: 1 addition & 1 deletion cucumber.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.add_dependency 'base64', '~> 0.2'
s.add_dependency 'builder', '~> 3.2'
s.add_dependency 'cucumber-ci-environment', '> 9', '< 14'
s.add_dependency 'cucumber-core', '>= 18', '< 19'
s.add_dependency 'cucumber-core', '>= 19', '< 20'
s.add_dependency 'cucumber-cucumber-expressions', '> 17', '< 21'
s.add_dependency 'cucumber-html-formatter', '> 21', '< 25'
s.add_dependency 'diff-lcs', '~> 1.5'
Expand Down
8 changes: 6 additions & 2 deletions lib/cucumber/events.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# frozen_string_literal: true

Dir["#{File.dirname(__FILE__)}/events/*.rb"].map(&method(:require))
require 'cucumber/core/event/base'

Dir[File.join(__dir__, 'events', '*.rb')].each do |file|
require_relative File.join('events', File.basename(file))
end

module Cucumber
# Events tell you what's happening while Cucumber runs your features.
Expand All @@ -23,7 +27,7 @@ def self.make_event_bus
end

def self.registry
Core::Events.build_registry(
Core::EventBus.build_registry(
AttachCalled,
GherkinSourceParsed,
GherkinSourceRead,
Expand Down
15 changes: 12 additions & 3 deletions lib/cucumber/events/attach_called.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# frozen_string_literal: true

require 'cucumber/core/events'

module Cucumber
module Events
# Fired when attach is called in a step definition
class AttachCalled < Core::Event.new(:src, :media_type, :filename)
class AttachCalled < Core::Event::Base
# The attachment body
attr_reader :src

Expand All @@ -14,6 +12,17 @@ class AttachCalled < Core::Event.new(:src, :media_type, :filename)

# An optional filename
attr_reader :filename

def self.event_id
:attach_called
end

def initialize(src, media_type, filename)
@src = src
@media_type = media_type
@filename = filename
super()
end
end
end
end
25 changes: 0 additions & 25 deletions lib/cucumber/events/base.rb

This file was deleted.

4 changes: 2 additions & 2 deletions lib/cucumber/events/envelope.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true

require_relative 'base'
require 'cucumber/core/event/base'

module Cucumber
module Events
class Envelope < Base
class Envelope < Core::Event::Base
attr_reader :envelope

def self.event_id
Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/events/gherkin_source_parsed.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# frozen_string_literal: true

require_relative 'base'

module Cucumber
module Events
# Fired after we've parsed the contents of a feature file
class GherkinSourceParsed < Base
class GherkinSourceParsed < Core::Event::Base
# # The Gherkin Ast
attr_reader :gherkin_document

Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/gherkin_source_read.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Cucumber
module Events
# Fired after we've read in the contents of a feature file
class GherkinSourceRead < Base
class GherkinSourceRead < Core::Event::Base
# The path to the file
attr_reader :path

Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/events/hook_test_step_created.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# frozen_string_literal: true

require_relative 'base'

module Cucumber
module Events
# Event fired when a step is created from a hook
class HookTestStepCreated < Base
class HookTestStepCreated < Core::Event::Base
attr_reader :test_step, :hook

def self.event_id
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/step_activated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Cucumber
module Events
# Event fired when a step is activated
class StepActivated < Base
class StepActivated < Core::Event::Base
# The test step that was matched.
# @return [Cucumber::Core::Test::Step]
attr_reader :test_step
Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/events/step_definition_registered.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# frozen_string_literal: true

require_relative 'base'

module Cucumber
module Events
# Event fired after each step definition has been registered
class StepDefinitionRegistered < Base
class StepDefinitionRegistered < Core::Event::Base
# The step definition that was just registered.
# @return [RbSupport::RbStepDefinition]
attr_reader :step_definition
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/test_case_created.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Cucumber
module Events
# Event fired when a Test::Case is created from a Pickle
class TestCaseCreated < Base
class TestCaseCreated < Core::Event::Base
attr_reader :test_case, :pickle

def self.event_id
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/test_case_finished.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Cucumber
module Events
# Event fired when a Test::Case is created from a Pickle
class TestCaseFinished < Base
class TestCaseFinished < Core::Event::Base
# @return [Cucumber::Core::Test::Case] that was executed
attr_reader :test_case

Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/test_case_ready.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Cucumber
module Events
class TestCaseReady < Base
class TestCaseReady < Core::Event::Base
attr_reader :test_case

def self.event_id
Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/events/test_case_started.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# frozen_string_literal: true

require_relative 'base'

module Cucumber
module Events
# Signals that a {Cucumber::Core::Test::Case} is about to be executed
class TestCaseStarted < Base
class TestCaseStarted < Core::Event::Base
# @return [Cucumber::Core::Test::Case] the test case to be executed
attr_reader :test_case

Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/test_run_finished.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Cucumber
module Events
# Event fired after all test cases have finished executing
class TestRunFinished < Base
class TestRunFinished < Core::Event::Base
attr_reader :success

def self.event_id
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/test_run_hook_finished.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Cucumber
module Events
class TestRunHookFinished < Base
class TestRunHookFinished < Core::Event::Base
attr_reader :hook, :test_result

def self.event_id
Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/events/test_run_hook_started.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# frozen_string_literal: true

require 'cucumber/core/events'

module Cucumber
module Events
class TestRunHookStarted < Base
class TestRunHookStarted < Core::Event::Base
attr_reader :hook

def self.event_id
Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/events/test_run_started.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# frozen_string_literal: true

require_relative 'base'

module Cucumber
module Events
# Event fired once all test cases have been filtered before
# the first one is executed.
class TestRunStarted < Base
class TestRunStarted < Core::Event::Base
# @return [Array<Cucumber::Core::Test::Case>] the test cases to be executed
attr_reader :test_cases

Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/events/test_step_created.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# frozen_string_literal: true

require_relative 'base'

module Cucumber
module Events
# Event fired when a TestStep is created from a PickleStep
class TestStepCreated < Base
class TestStepCreated < Core::Event::Base
attr_reader :test_step, :pickle_step

def self.event_id
Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/events/test_step_finished.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# frozen_string_literal: true

require_relative 'base'

module Cucumber
module Events
# Signals that a {Cucumber::Core::Test::Step} has finished executing
class TestStepFinished < Base
class TestStepFinished < Core::Event::Base
# @return [Cucumber::Core::Test::Step] the test step that was executed
attr_reader :test_step

Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/events/test_step_started.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# frozen_string_literal: true

require_relative 'base'

module Cucumber
module Events
# Signals that a {Cucumber::Core::Test::Step} is about to be executed
class TestStepStarted < Base
class TestStepStarted < Core::Event::Base
# @return [Cucumber::Core::Test::Step] the test step to be executed
attr_reader :test_step

Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/undefined_parameter_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Cucumber
module Events
class UndefinedParameterType < Base
class UndefinedParameterType < Core::Event::Base
attr_reader :type_name, :expression

def self.event_id
Expand Down
22 changes: 12 additions & 10 deletions lib/cucumber/glue/registry_and_more.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
require 'cucumber/cucumber_expressions/cucumber_expression_generator'
require 'cucumber/messages/helpers/time_conversion'

require 'cucumber/glue/dsl'
require 'cucumber/glue/snippet'
require 'cucumber/glue/hook'
require 'cucumber/glue/proto_world'
require 'cucumber/glue/step_definition'
require 'cucumber/glue/world_factory'
require 'cucumber/gherkin/i18n'
require_relative 'dsl'
require_relative 'snippet'
require_relative 'hook'
require_relative 'proto_world'
require_relative 'step_definition'
require_relative 'world_factory'
require_relative '../step_match'
require_relative '../gherkin/i18n'

require 'multi_test'
require 'cucumber/step_match'
require 'cucumber/events/base'
require 'cucumber/events/step_definition_registered'
require 'cucumber/core/event/base'

require_relative '../events/step_definition_registered'

require_relative 'multiple_world'
require_relative 'nil_world'
Expand Down
Loading