| |
@@ -0,0 +1,72 @@
|
| |
+ From 2b1c25d247aba492e582a01cff8ecdd33d4d165b Mon Sep 17 00:00:00 2001
|
| |
+ From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= <dcermak@suse.com>
|
| |
+ Date: Mon, 28 Feb 2022 10:46:17 +0100
|
| |
+ Subject: [PATCH 1/2] Stop using the last argument as kwargs in unit tests
|
| |
+
|
| |
+ A few unit tests started failing with Ruby 3.0, because they were relying on
|
| |
+ keyword arguments being converted into hashes automatically. This behavior was
|
| |
+ deprecated in Ruby 2.7 and results in errors in Ruby 3.0 onward.
|
| |
+
|
| |
+ For further details:
|
| |
+ https://rubyreferences.github.io/rubychanges/3.0.html#keyword-arguments-are-now-fully-separated-from-positional-arguments
|
| |
+ ---
|
| |
+ test/unit/plugins/commands/package/command_test.rb | 4 ++--
|
| |
+ .../plugins/providers/hyperv/action/read_guest_ip_test.rb | 2 +-
|
| |
+ test/unit/vagrant/ui_test.rb | 4 ++--
|
| |
+ 3 files changed, 5 insertions(+), 5 deletions(-)
|
| |
+
|
| |
+ diff --git a/test/unit/plugins/commands/package/command_test.rb b/test/unit/plugins/commands/package/command_test.rb
|
| |
+ index 7b289bd1e3a..d0f81393bf6 100644
|
| |
+ --- a/test/unit/plugins/commands/package/command_test.rb
|
| |
+ +++ b/test/unit/plugins/commands/package/command_test.rb
|
| |
+ @@ -64,7 +64,7 @@
|
| |
+
|
| |
+ it "packages default machine inside specified folder" do
|
| |
+ expect(package_command).to receive(:package_vm).with(
|
| |
+ - a_machine_named('default'), :output => "package-output-folder/default"
|
| |
+ + a_machine_named('default'), { output: "package-output-folder/default" }
|
| |
+ )
|
| |
+ package_command.execute
|
| |
+ end
|
| |
+ @@ -96,7 +96,7 @@
|
| |
+ let(:argv){ ['--base', 'machine-id'] }
|
| |
+
|
| |
+ it "packages vm defined within virtualbox" do
|
| |
+ - expect(package_command).to receive(:package_base).with(:base => 'machine-id')
|
| |
+ + expect(package_command).to receive(:package_base).with({ base: 'machine-id' })
|
| |
+ package_command.execute
|
| |
+ end
|
| |
+
|
| |
+ diff --git a/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb b/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb
|
| |
+ index 5642c6271f1..ecce003a602 100644
|
| |
+ --- a/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb
|
| |
+ +++ b/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb
|
| |
+ @@ -31,7 +31,7 @@
|
| |
+ end
|
| |
+
|
| |
+ it "should set the host information into the env" do
|
| |
+ - expect(env).to receive(:[]=).with(:machine_ssh_info, host: "ADDRESS")
|
| |
+ + expect(env).to receive(:[]=).with(:machine_ssh_info, { host: "ADDRESS" })
|
| |
+ expect(driver).to receive(:read_guest_ip).and_return("ip" => "ADDRESS")
|
| |
+ subject.call(env)
|
| |
+ end
|
| |
+ diff --git a/test/unit/vagrant/ui_test.rb b/test/unit/vagrant/ui_test.rb
|
| |
+ index e484b81543b..120b1dda2a6 100644
|
| |
+ --- a/test/unit/vagrant/ui_test.rb
|
| |
+ +++ b/test/unit/vagrant/ui_test.rb
|
| |
+ @@ -379,12 +379,12 @@
|
| |
+
|
| |
+ describe "#machine" do
|
| |
+ it "sets the target option" do
|
| |
+ - expect(ui).to receive(:machine).with(:foo, target: prefix)
|
| |
+ + expect(ui).to receive(:machine).with(:foo, { target: prefix })
|
| |
+ subject.machine(:foo)
|
| |
+ end
|
| |
+
|
| |
+ it "preserves existing options" do
|
| |
+ - expect(ui).to receive(:machine).with(:foo, :bar, foo: :bar, target: prefix)
|
| |
+ + expect(ui).to receive(:machine).with(:foo, :bar, { foo: :bar, target: prefix })
|
| |
+ subject.machine(:foo, :bar, foo: :bar)
|
| |
+ end
|
| |
+ end
|
| |
+
|
| |
@pvalena PTAL
Fixes FTBFS, but it does not fix the runtime.