From 6ef7ea6be0d395868b4cf055b9470f9a8cf7a909 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 28 Dec 2019 09:58:55 +0100 Subject: [PATCH 1/4] Silence keyword argument warnings on Ruby 2.7 --- lib/aruba/platforms/unix_platform.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/aruba/platforms/unix_platform.rb b/lib/aruba/platforms/unix_platform.rb index a656130ce..f3bb76767 100644 --- a/lib/aruba/platforms/unix_platform.rb +++ b/lib/aruba/platforms/unix_platform.rb @@ -125,7 +125,8 @@ def mkdir(dir_name) def rm(paths, options = {}) paths = Array(paths).map { |p| ::File.expand_path(p) } - FileUtils.rm_r(paths, options) + FileUtils.rm_r(paths, :force => options[:force], :noop => options[:noop], + :verbose => options[:verbose], :secure => options[:secure]) end # Get current working directory @@ -144,7 +145,8 @@ def chdir(dir_name, &block) # Touch file, directory def touch(args, options) - FileUtils.touch(args, options) + FileUtils.touch(args, :noop => options[:noop], :verbose => options[:verbose], + :mtime => options[:mtime], :nocreate => options[:nocreate]) end # Copy file/directory @@ -159,7 +161,8 @@ def mv(args, options) # Change mode of file/directory def chmod(mode, args, options) - FileUtils.chmod_R(mode, args, options) + FileUtils.chmod_R(mode, args, :noop => options[:noop], + :verbose => options[:verbose], :force => options[:force]) end # Exists and is file From c37c40ad626ae1e17b01ca86b7c31e515a7a5a9f Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 28 Dec 2019 15:22:05 +0100 Subject: [PATCH 2/4] Clarify method parameter names --- lib/aruba/platforms/unix_platform.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/aruba/platforms/unix_platform.rb b/lib/aruba/platforms/unix_platform.rb index f3bb76767..ccfd8434c 100644 --- a/lib/aruba/platforms/unix_platform.rb +++ b/lib/aruba/platforms/unix_platform.rb @@ -150,13 +150,13 @@ def touch(args, options) end # Copy file/directory - def cp(args, options) - FileUtils.cp_r(args, options) + def cp(src, dest) + FileUtils.cp_r(src, dest) end # Move file/directory - def mv(args, options) - FileUtils.mv(args, options) + def mv(src, dest) + FileUtils.mv(src, dest) end # Change mode of file/directory From d0076164a85e41ada00fed71740a44448692a9ee Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 28 Dec 2019 15:10:58 +0100 Subject: [PATCH 3/4] Update scenario to pass on Ruby 2.7 When running under childprocess, IRB does not activate readline. This means history is not collected and the history file is empty if saved. In Ruby 2.7, the file is not even written to. This means saving the history file cannot properly be tested on Ruby 2.7 using Aruba. Instead, we check that the correct file is configured in IRB, and just assume IRB will do the right thing with it. --- features/cli/console.feature | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/features/cli/console.feature b/features/cli/console.feature index 88f95dc99..b79a3a827 100644 --- a/features/cli/console.feature +++ b/features/cli/console.feature @@ -44,9 +44,12 @@ Feature: Aruba Console """ @unsupported-on-platform-java - Scenario: Has history + Scenario: Has its own history file Given I run `aruba console` interactively - And I type "aruba_methods" + And I type "IRB.conf[:HISTORY_FILE]" And I type "exit" When I close the stdin stream - Then the file "~/.aruba_history" should exist + Then the output should contain: + """ + ~/.aruba_history + """