Update tests for GRPC errors
This commit is contained in:
parent
deb667ecd3
commit
53f7b3f8eb
@ -24,16 +24,12 @@ module VagrantPlugins
|
||||
end
|
||||
Thread.current.thread_variable_set(:service_info, info)
|
||||
return if !block_given?
|
||||
begin
|
||||
yield info
|
||||
rescue
|
||||
raise
|
||||
ensure
|
||||
Service::ServiceInfo.manager_tracker.deactivate do
|
||||
Vagrant.plugin("2").disable_remote_manager
|
||||
end
|
||||
Thread.current.thread_variable_set(:service_info, nil)
|
||||
yield info
|
||||
ensure
|
||||
Service::ServiceInfo.manager_tracker.deactivate do
|
||||
Vagrant.plugin("2").disable_remote_manager
|
||||
end
|
||||
Thread.current.thread_variable_set(:service_info, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -65,7 +65,7 @@ describe VagrantPlugins::CommandServe::Service::HostService do
|
||||
|
||||
it "raises an error for unknown plugins" do
|
||||
ctx = DummyContext.new("idontexisthahaha")
|
||||
expect { subject.parent("", ctx) }.to raise_error(RuntimeError)
|
||||
expect { subject.parent("", ctx) }.to raise_error(GRPC::BadStatus)
|
||||
end
|
||||
|
||||
it "requests parent from plugins" do
|
||||
@ -101,7 +101,7 @@ describe VagrantPlugins::CommandServe::Service::HostService do
|
||||
|
||||
it "raises an error for unknown plugins" do
|
||||
ctx = DummyContext.new("idontexisthahaha")
|
||||
expect { subject.detect("", ctx) }.to raise_error(RuntimeError)
|
||||
expect { subject.detect("", ctx) }.to raise_error(GRPC::BadStatus)
|
||||
end
|
||||
|
||||
it "detects true plugins" do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user