-
Notifications
You must be signed in to change notification settings - Fork 30
Change how we warn about server not running #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,23 +22,6 @@ class RailsClientTest < ActiveSupport::TestCase | |
assert_equal(expected_response, RailsClient.instance.model("User")) | ||
end | ||
|
||
test "raises during instantiation if app_uri file doesn't exist" do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer relevant since we don't do anything during instantiation. |
||
project_root = Pathname.new(ENV["BUNDLE_GEMFILE"]).dirname | ||
app_uri_path = "#{project_root}/test/dummy/tmp/app_uri.txt" | ||
FileUtils.rm(app_uri_path) | ||
|
||
# If the RailsClient singleton was initialized in a different test successfully, then there would be no chance | ||
# for this assertion to pass. We need to reset the singleton instance in order to force `initialize` to be | ||
# executed again | ||
Singleton.send(:__init__, RailsClient) | ||
|
||
assert_raises(RailsClient::NeedsRestartError) do | ||
RailsClient.instance | ||
end | ||
ensure | ||
File.write(T.must(app_uri_path), "http://localhost:3000") | ||
end | ||
|
||
test "instantiation finds the right directory when bundle gemfile points to .ruby-lsp" do | ||
previous_bundle_gemfile = ENV["BUNDLE_GEMFILE"] | ||
project_root = Pathname.new(previous_bundle_gemfile).dirname | ||
|
@@ -57,7 +40,7 @@ class RailsClientTest < ActiveSupport::TestCase | |
test "check_if_server_is_running! raises if no server is found" do | ||
Net::HTTP.any_instance.expects(:get).raises(Errno::ECONNREFUSED) | ||
|
||
assert_raises(RailsClient::ServerNotRunningError) do | ||
assert_output("", RailsClient::SERVER_NOT_RUNNING_MESSAGE + "\n") do | ||
RailsClient.instance.check_if_server_is_running! | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,6 @@ | |
require "ruby_lsp/internal" | ||
require "ruby_lsp/ruby_lsp_rails/extension" | ||
|
||
$VERBOSE = nil unless ENV["VERBOSE"] || ENV["CI"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was added to reduce noise in test outout, but it was preventing us from asserting against stderr. |
||
|
||
module ActiveSupport | ||
class TestCase | ||
include SyntaxTree::DSL | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer relevant since we don't raise.