-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Environment Information
Provide at least:
- JRuby 9.4 - no flags
- GitHub CI runs found here: https://github.com/cucumber/cucumber-ruby-core/actions/runs/6578797110/job/18114639421
Actual Behavior
- When running tests on ruby 2.5+ there is a scenario performing a long test. Said scenario will then do a parallel assign of iVars on initialize.
For ruby 2.5+ the following is observed
0> event
=> #<Cucumber::Core::Events::TestStepFinished:0x000055602c739358 @test_step=#<Cucumber::Core::Test::Step: features/test.feature:4>, @result=#<Cucumber::Core::Test::Result::Passed:0x000055602c739510 @duration=#<Cucumber::Core::Test::Result::Duration:0x000055602c739538 @nanoseconds=1016>>>
0> event.attributes
=> [#<Cucumber::Core::Test::Step: features/test.feature:4>, #<Cucumber::Core::Test::Result::Passed:0x000055602c739510 @duration=#<Cucumber::Core::Test::Result::Duration:0x000055602c739538 @nanoseconds=1016>>]
However these 2 values in the array are reversed in JRuby 9.4.4
0> event
=> #<Cucumber::Core::Events::TestStepFinished:0x7f426ddd @result=#<Cucumber::Core::Test::Result::Passed:0x3a209918 @duration=#<Cucumber::Core::Test::Result::Duration:0x2cae5fa7 @nanoseconds=45101>>, @test_step=#<Cucumber::Core::Test::Step: features/test.feature:4>>
0> event.attributes
=> [#<Cucumber::Core::Test::Result::Passed:0x3a209918 @duration=#<Cucumber::Core::Test::Result::Duration:0x2cae5fa7 @nanoseconds=45101>>, #<Cucumber::Core::Test::Step: features/test.feature:4>]
- Provide an executable Ruby script or a link to an example repository.
Expected Behavior
Should be identical
NB: The portion of the code that generates these is quite metaprogram heavy
Class.new(Event) do
attr_reader(*events)
define_method(:initialize) do |*attributes|
events.zip(attributes) do |name, value|
instance_variable_set("@#{name}".to_sym, value)
end
end
def attributes
instance_variables.map { |var| instance_variable_get(var) }
end
.... # more stuff
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels