summaryrefslogtreecommitdiffstats
path: root/spec/unit/network/xmlrpc/client.rb
blob: a0a2e77fb4562b0fba92ddf35fe4b9fa16732ac5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env ruby

Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }

describe Puppet::Network do
    it "should raise an XMLRPCClientError if a generated class raises a Timeout::Error" do
        http = mock 'http'
        Puppet::Network::HttpPool.stubs(:http_instance).returns http
        file = Puppet::Network::Client.file.new({:Server => "foo.com"})
        http.stubs(:post2).raises Timeout::Error
        lambda { file.retrieve }.should raise_error(Puppet::Network::XMLRPCClientError)
    end
end