lib/autoproj/aruba_minitest.rb in autoproj-2.14.0 vs lib/autoproj/aruba_minitest.rb in autoproj-2.15.0

- old
+ new

@@ -1,6 +1,6 @@ -require 'aruba/api' +require "aruba/api" module Autoproj # Minitest-usable Aruba wrapper # # Aruba 0.14 is incompatible with Minitest because of their definition @@ -25,25 +25,23 @@ super end def generate_local_gemfile path = expand_path("Gemfile.local") - File.open(path, 'w') do |io| + File.open(path, "w") do |io| io.write <<~GEMFILE source "https://rubygems.org" - gem "autoproj", path: "#{File.expand_path("../../", __dir__)}" + gem "autoproj", path: "#{File.expand_path('../../', __dir__)}" GEMFILE end path end def run_command_and_stop(*args, fail_on_error: true, **kwargs) cmd = run_command(*args, **kwargs) cmd.stop - if fail_on_error - assert_command_finished_successfully(cmd) - end + assert_command_finished_successfully(cmd) if fail_on_error cmd end def run_command(*args, **kwargs) @aruba_api.run_command(*args, **kwargs) @@ -57,25 +55,22 @@ @aruba_api.chmod(*args) end def method_missing(m, *args, &block) if @aruba_api.respond_to?(m) - return @aruba_api.send(m, *args, &block) + @aruba_api.send(m, *args, &block) else super end end def assert_command_stops(cmd, fail_on_error: true) cmd.stop - if fail_on_error - assert_command_finished_successfully(cmd) - end + assert_command_finished_successfully(cmd) if fail_on_error end def assert_command_finished_successfully(cmd) refute cmd.timed_out?, "#{cmd} timed out on stop" assert_equal 0, cmd.exit_status, "#{cmd} finished with a non-zero exit status (#{cmd.exit_status})\n-- STDOUT\n#{cmd.stdout}\n-- STDERR\n#{cmd.stderr}" end end end -