diff options
Diffstat (limited to 'spec/unit/agent/downloader.rb')
| -rwxr-xr-x | spec/unit/agent/downloader.rb | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/spec/unit/agent/downloader.rb b/spec/unit/agent/downloader.rb index 6b07e5bb4..5c53de824 100755 --- a/spec/unit/agent/downloader.rb +++ b/spec/unit/agent/downloader.rb @@ -20,15 +20,6 @@ describe Puppet::Agent::Downloader do dler.source.should == "source" end - it "should be able to provide a timeout value" do - Puppet::Agent::Downloader.should respond_to(:timeout) - end - - it "should use the configtimeout, converted to an integer, as its timeout" do - Puppet.settings.expects(:value).with(:configtimeout).returns "50" - Puppet::Agent::Downloader.timeout.should == 50 - end - describe "when creating the file that does the downloading" do before do @dler = Puppet::Agent::Downloader.new("foo", "path", "source") @@ -118,8 +109,8 @@ describe Puppet::Agent::Downloader do @dler.evaluate end - it "should set a timeout for the download" do - Puppet::Agent::Downloader.expects(:timeout).returns 50 + it "should use the agent timeout for the download" do + Puppet::Agent.expects(:timeout).returns 50 Timeout.expects(:timeout).with(50) @dler.evaluate @@ -153,7 +144,7 @@ describe Puppet::Agent::Downloader do @dler.evaluate.should == %w{/changed/file} end - it "should yield the resources if a block is given" do + it "should yield the downloaded file's path if a block is given" do trans = mock 'transaction' catalog = mock 'catalog' @@ -163,13 +154,13 @@ describe Puppet::Agent::Downloader do Timeout.expects(:timeout).yields resource = mock 'resource' - resource.expects(:[]).with(:path).returns "/changed/file" + resource.stubs(:[]).with(:path).returns "/changed/file" trans.expects(:changed?).returns([resource]) yielded = nil @dler.evaluate { |r| yielded = r } - yielded.should == resource + yielded.should == "/changed/file" end it "should catch and log exceptions" do |
