spec/whm/server_spec.rb in lumberg-2.0.1 vs spec/whm/server_spec.rb in lumberg-3.0.0
- old
+ new
@@ -41,11 +41,25 @@
it "raises message for invalid domain" do
Resolv.stub(:getaddress).and_raise(Resolv::ResolvError)
expect do
Whm::Server.new(host: "nxdomain.tld", hash: "")
end.to raise_error(
- Lumberg::WhmArgumentError, "Unable to resolve nxdomain.tld"
+ Lumberg::WhmArgumentError, "Unable to resolve nxdomain.tld"
)
+ end
+
+ it "raises message for connection failed" do
+ VCR.turn_off!
+ stub_request(:get, "#{@url_base}/version").to_timeout
+
+ expect do
+ @whm = Whm::Server.new(@login)
+ @whm.version
+ end.to raise_error(
+ Lumberg::WhmConnectionError, "#{@login[:host]} is either unavailable or is not currently accepting requests. Please try again in a few minutes."
+ )
+
+ VCR.turn_on!
end
end
describe "setting timeout" do
it "allows setting of timeout" do