diff --git a/lib/scenario_disabler.rb b/lib/scenario_disabler.rb index 81ee10faf4..10d5ca7910 100644 --- a/lib/scenario_disabler.rb +++ b/lib/scenario_disabler.rb @@ -12,8 +12,7 @@ class ScenarioDisabler def self.empty_if_disabled(scenario) if self.disabled?(scenario) - step_collection = scenario.instance_variable_get(:@steps) - step_collection.instance_variable_set(:@steps, []) + scenario.instance_variable_set(:@steps,::Cucumber::Ast::StepCollection.new([])) true else