Skip to content

Conversation

@obrie
Copy link

@obrie obrie commented Dec 23, 2025

This adds support for Ruby 4.0. Note this is currently broken for flatware-cucumber due to a change in Ruby that was fixed here: cucumber/cucumber-ruby-core#302

Opening this PR to start a discussion around how you want to move forward to address this. We could change the minimum version require for flatware-cucumber. I haven't spent time thinking through potential alternatives yet. Example of failure:

  1) Flatware::Cucumber.configure copies the arguments into each job
     Failure/Error: cli_config.parse! args + %w[--format Flatware::Cucumber::Formatter]
     
     Cucumber::Cli::YmlLoadError:
       cucumber.yml was found, but could not be parsed with ERB.  Please refer to cucumber's documentation on correct profile usage.
       #<ArgumentError: wrong number of arguments (given 3, expected 1)>
     # ./lib/flatware/cucumber.rb:38:in 'Flatware::Cucumber.configure'
     # ./spec/flatware/cucumber_spec.rb:7:in 'block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # ArgumentError:
     #   wrong number of arguments (given 3, expected 1)
     #   ./lib/flatware/cucumber.rb:38:in 'Flatware::Cucumber.configure'

  2) Flatware::Cucumber run with multiple scenarios in the same file calls the steps the correct number of times
     Failure/Error: puts event.inspect
     
     ArgumentError:
       wrong number of arguments (given 5, expected 2)
     # ./lib/flatware/cucumber/formatter.rb:53:in 'Kernel#inspect'
     # ./lib/flatware/cucumber/formatter.rb:53:in 'Flatware::Cucumber::Formatter#on_step_activated'
     # ./lib/flatware/cucumber.rb:44:in 'Flatware::Cucumber.run'
     # ./spec/flatware/cucumber_spec.rb:39:in 'block (5 levels) in <top (required)>'
     # ./spec/flatware/cucumber_spec.rb:38:in 'Dir.chdir'
     # ./spec/flatware/cucumber_spec.rb:38:in 'block (4 levels) in <top (required)>'

@obrie
Copy link
Author

obrie commented Dec 23, 2025

When running this on newer versions of cucumber, we get:

  1) Flatware::Cucumber run with multiple scenarios in the same file calls the steps the correct number of times
     Failure/Error: expect(Flatware).to have_received(:ran).with(3)
     
       Flatware received :ran with unexpected arguments
         expected: (3)
              got: (1) (1 time)
                   (2) (1 time)
     # ./spec/flatware/cucumber_spec.rb:47:in 'block (5 levels) in <top (required)>'
     # ./spec/flatware/cucumber_spec.rb:41:in 'Dir.chdir'
     # ./spec/flatware/cucumber_spec.rb:41:in 'block (4 levels) in <top (required)>'

I haven't quite figured that one out either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant