Skip to content

Commit 12f8d0d

Browse files
committed
Add tests for NullClient
1 parent d55243d commit 12f8d0d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/ruby_lsp_rails/runner_client_test.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,33 @@ class RunnerClientTest < ActiveSupport::TestCase
8787
FileUtils.mv("test/dummy/config/application.rb.bak", "test/dummy/config/application.rb")
8888
end
8989
end
90+
91+
class NullClientTest < ActiveSupport::TestCase
92+
setup { @client = NullClient.new }
93+
94+
test "#shutdown is a no-op" do
95+
assert_nothing_raised { @client.shutdown }
96+
end
97+
98+
test "#stopped? is always true" do
99+
assert_predicate @client, :stopped?
100+
end
101+
102+
test "#rails_root is just the current working directory" do
103+
assert_equal Dir.pwd, @client.rails_root
104+
end
105+
106+
test "#send_message is a no-op" do
107+
assert_nothing_raised { @client.send(:send_message, "request", nil) }
108+
end
109+
110+
test "#send_notification is a no-op" do
111+
assert_nothing_raised { @client.send(:send_notification, "request", nil) }
112+
end
113+
114+
test "#read_response is a no-op" do
115+
assert_nothing_raised { @client.send(:read_response) }
116+
end
117+
end
90118
end
91119
end

0 commit comments

Comments
 (0)