diff --git a/lib/cask/system_command.rb b/lib/cask/system_command.rb index 45a6ce6718ade..7dc77aac070c6 100644 --- a/lib/cask/system_command.rb +++ b/lib/cask/system_command.rb @@ -28,11 +28,11 @@ def self.run(executable, options={}) raw_stderr.close_read # Ruby 1.8 sets $?. Ruby 1.9+ has raw_wait_thr, and does not set $?. - processed_exit_status = raw_wait_thr.nil? ? $? : raw_wait_thr.value + processed_status = raw_wait_thr.nil? ? $? : raw_wait_thr.value - _assert_success(processed_exit_status, command, processed_stdout) if options[:must_succeed] + _assert_success(processed_status, command, processed_stdout) if options[:must_succeed] - Cask::SystemCommand::Result.new(command, processed_stdout, processed_stderr, processed_exit_status) + Cask::SystemCommand::Result.new(command, processed_stdout, processed_stderr, processed_status.exitstatus) end def self.run!(command, options={}) diff --git a/test/cask/system_command_test.rb b/test/cask/system_command_test.rb index 8e17e12609eac..82bad69f75b23 100644 --- a/test/cask/system_command_test.rb +++ b/test/cask/system_command_test.rb @@ -24,7 +24,7 @@ describe "when the exit code is 1" do before do # See: https://bugs.ruby-lang.org/issues/1287 - skip("Ruby 1.8.7 doesn’t see exit statuses") if TestHelper.ruby18? + skip("Ruby 1.8.7 doesn't see exit statuses") if TestHelper.ruby18? end describe "and the command must succeed" do