1 year ago
#215074
Snehal Dwivedi
facing ERROR: ArgumentError: wrong number of arguments (given 3, expected 2) ruby 3 aruba
after upgrading ruby from 2.7 to 3.0 to 3.1 I am facing fowling issue while running the cucumber test
Given a local mode chef repo with nodes 'one,two,three' # features/step_definitions/chef-repo.rb:2
Expected `knife client create admin -c config.rb -f admin.pem` to succeed but got non-zero exit status and the following output:
ERROR: ArgumentError: wrong number of arguments (given 3, expected 2)
(RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/chef-repo.rb:66:in `create_client'
./features/step_definitions/chef-repo.rb:58:in `create_admin'
./features/step_definitions/chef-repo.rb:20:in `block (2 levels) in <top (required)>'
./features/step_definitions/chef-repo.rb:19:in `each'
./features/step_definitions/chef-repo.rb:19:in `/^a local mode chef repo with nodes '(.+?)'(?: with admins '(.+?)')?$/'
features/clean.feature:11:in `a local mode chef repo with nodes 'one,two,three''
And I create a vault item 'test/item' containing the JSON '{"foo": "bar"}' encrypted for 'one,two' # features/step_definitions/chef-vault.rb:4
Then the vault item 'test/item' should be encrypted for 'one,two' # features/step_definitions/chef-vault.rb:48
And I update the vault item 'test/item' to be encrypted for 'two,three' # features/step_definitions/chef-vault.rb:14
Then the vault item 'test/item' should be encrypted for 'one,two,three'
It's failing under Auba SpawnProcess start command. Tried upgrading and downgrading arbua version 'aruba', '~> 2.0' & gem 'aruba', '0.5.4' nothing working can someone please help me with this?
in chef-repo.rb its failing on run_command_and_stop
def create_client(name, args = nil)
command = "knife client create #{name} -c config.rb -f #{name}.pem"
run_command_and_stop(command, fail_on_error: true)
write_file("#{name}.pem", last_command_started.stdout)
end
here if we step in run_command_and_stop
its fails on command.start
following code in aruba
def start_command(command)
259: aruba.config.run_before_hook(:command, self, command)
260:
261: in_current_directory do
262: command.start
263: end
264:
=> 265: stop_signal = command.stop_signal
266: aruba.announcer.announce(:stop_signal, command.pid, stop_signal) if stop_signal
267:
268: aruba.config.run_after_hook(:command, self, command)
269: end
cucumber
aruba
ruby-3
ruby-3.1
0 Answers
Your Answer