spec/unit/configurer/downloader_spec.rb in puppet-2.7.26 vs spec/unit/configurer/downloader_spec.rb in puppet-3.0.0.rc4
- old
+ new
@@ -1,6 +1,6 @@
-#!/usr/bin/env rspec
+#! /usr/bin/env ruby -S rspec
require 'spec_helper'
require 'puppet/configurer/downloader'
describe Puppet::Configurer::Downloader do
@@ -20,16 +20,16 @@
dler.path.should == "path"
dler.source.should == "source"
end
it "should be able to provide a timeout value" do
- Puppet::Configurer::Downloader.should respond_to(:timeout)
+ Puppet::Configurer::Downloader.should respond_to(:timeout_interval)
end
it "should use the configtimeout, converted to an integer, as its timeout" do
- Puppet.settings.expects(:value).with(:configtimeout).returns "50"
- Puppet::Configurer::Downloader.timeout.should == 50
+ Puppet[:configtimeout] = "50"
+ Puppet::Configurer::Downloader.timeout_interval.should == 50
end
describe "when creating the file that does the downloading" do
before do
@dler = Puppet::Configurer::Downloader.new("foo", "path", "source")
@@ -153,10 +153,10 @@
@dler.evaluate
end
it "should set a timeout for the download" do
- Puppet::Configurer::Downloader.expects(:timeout).returns 50
+ Puppet::Configurer::Downloader.expects(:timeout_interval).returns 50
Timeout.expects(:timeout).with(50)
@dler.evaluate
end