Skip to content

Commit

Permalink
Merge pull request #12038 from knu/output_restarting_message_to_stderr
Browse files Browse the repository at this point in the history
Output the "server restarting" message to stderr
  • Loading branch information
koic committed Jul 9, 2023
2 parents 97af128 + 34faa8c commit a573855
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#12038](https://github.com/rubocop/rubocop/pull/12038): Output the "server restarting" message to stderr. ([@knu][])
2 changes: 1 addition & 1 deletion lib/rubocop/server/client_command/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run

def ensure_server!
if incompatible_version?
puts 'RuboCop version incompatibility found, RuboCop server restarting...'
warn 'RuboCop version incompatibility found, RuboCop server restarting...'
ClientCommand::Stop.new.run
elsif check_running_server
return
Expand Down
3 changes: 2 additions & 1 deletion spec/rubocop/server/rubocop_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
RuboCop::Server::Cache.write_version_file('0.99.9')

expect(`ruby -I . "#{rubocop}" --server-status`).to match(/RuboCop server .* is running/)
expect(`ruby -I . "#{rubocop}" #{options}`).to start_with(
_stdout, stderr, _status = Open3.capture3("ruby -I . \"#{rubocop}\" #{options}")
expect(stderr).to start_with(
'RuboCop version incompatibility found, RuboCop server restarting...'
)
end
Expand Down

0 comments on commit a573855

Please sign in to comment.