summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Campbell <hikeit@gmail.com>2013-03-11 16:09:27 -0400
committerJesse Campbell <hikeit@gmail.com>2013-03-11 16:09:27 -0400
commit4a8ab8f2c0eafb8c679968672e05c401760092ce (patch)
treebaa07de0e9c4510a10dc0c081c0fb84ab20a33ec
parent106069617788c0235e76ef470862c752cb25fec1 (diff)
downloadchef-4a8ab8f2c0eafb8c679968672e05c401760092ce.tar.gz
fix tests
-rw-r--r--spec/unit/provider/remote_file/ftp_spec.rb20
-rw-r--r--spec/unit/provider/remote_file_spec.rb4
2 files changed, 12 insertions, 12 deletions
diff --git a/spec/unit/provider/remote_file/ftp_spec.rb b/spec/unit/provider/remote_file/ftp_spec.rb
index bf27e1aee0..a51249fe92 100644
--- a/spec/unit/provider/remote_file/ftp_spec.rb
+++ b/spec/unit/provider/remote_file/ftp_spec.rb
@@ -59,44 +59,44 @@ describe Chef::Provider::RemoteFile::FTP do
describe "when connecting to the remote" do
it "should connect to the host from the uri on the default port 21" do
@ftp.should_receive(:connect).with("opscode.com", 21)
- Chef::Provider::RemoteFile::FTP.new(@uri, nil, false).connect
+ Chef::Provider::RemoteFile::FTP.new(@uri, false).connect
end
it "should connect on an alternate port when one is provided" do
@ftp.should_receive(:connect).with("opscode.com", 8021)
- Chef::Provider::RemoteFile::FTP.new(URI.parse("ftp://opscode.com:8021/seattle.txt"), nil, false).connect
+ Chef::Provider::RemoteFile::FTP.new(URI.parse("ftp://opscode.com:8021/seattle.txt"), false).connect
end
it "should set passive true when ftp_active_mode is false" do
@ftp.should_receive(:passive=).with(true)
- Chef::Provider::RemoteFile::FTP.new(@uri, nil, false).connect
+ Chef::Provider::RemoteFile::FTP.new(@uri, false).connect
end
it "should set passive false when ftp_active_mode is false" do
@ftp.should_receive(:passive=).with(false)
- Chef::Provider::RemoteFile::FTP.new(@uri, nil, true).connect
+ Chef::Provider::RemoteFile::FTP.new(@uri, true).connect
end
it "should use anonymous ftp when no userinfo is provided" do
@ftp.should_receive(:login).with("anonymous", nil)
- Chef::Provider::RemoteFile::FTP.new(@uri, nil, false).connect
+ Chef::Provider::RemoteFile::FTP.new(@uri, false).connect
end
it "should use authenticated ftp when userinfo is provided" do
@ftp.should_receive(:login).with("the_user", "the_password")
- Chef::Provider::RemoteFile::FTP.new(URI.parse("ftp://the_user:the_password@opscode.com/seattle.txt"), nil, false).connect
+ Chef::Provider::RemoteFile::FTP.new(URI.parse("ftp://the_user:the_password@opscode.com/seattle.txt"), false).connect
end
it "should accept ascii for the typecode" do
@uri.typecode = "a"
@ftp.should_receive(:voidcmd).with("TYPE A").once
- Chef::Provider::RemoteFile::FTP.fetch(@uri, nil, false, nil)
+ Chef::Provider::RemoteFile::FTP.fetch(@uri, false, nil)
end
it "should accept image for the typecode" do
@uri.typecode = "i"
@ftp.should_receive(:voidcmd).with("TYPE I").once
- Chef::Provider::RemoteFile::FTP.fetch(@uri, nil, false, nil)
+ Chef::Provider::RemoteFile::FTP.fetch(@uri, false, nil)
end
it "should fetch the file from the correct path" do
@@ -104,13 +104,13 @@ describe Chef::Provider::RemoteFile::FTP do
@ftp.should_receive(:voidcmd).with("CWD whole").once
@ftp.should_receive(:voidcmd).with("CWD path").once
@ftp.should_receive(:getbinaryfile).with("seattle.txt", @tempfile.path)
- Chef::Provider::RemoteFile::FTP.fetch(URI.parse("ftp://opscode.com/the/whole/path/seattle.txt"), nil, false, nil)
+ Chef::Provider::RemoteFile::FTP.fetch(URI.parse("ftp://opscode.com/the/whole/path/seattle.txt"), false, nil)
end
end
describe "when it finishes downloading" do
it "should return a tempfile" do
- ftpfile, mtime = Chef::Provider::RemoteFile::FTP.fetch(@uri, nil, false, nil)
+ ftpfile, mtime = Chef::Provider::RemoteFile::FTP.fetch(@uri, false, nil)
ftpfile.should equal @tempfile
ftpfile.close!
end
diff --git a/spec/unit/provider/remote_file_spec.rb b/spec/unit/provider/remote_file_spec.rb
index 9f22fc5df5..d055180a4a 100644
--- a/spec/unit/provider/remote_file_spec.rb
+++ b/spec/unit/provider/remote_file_spec.rb
@@ -204,13 +204,13 @@ describe Chef::Provider::RemoteFile, "action_create" do
end
it "should fetch with ftp in passive mode" do
- Chef::Provider::RemoteFile::FTP.should_receive(:fetch).with(URI.parse("ftp://opscode.com/seattle.txt"), nil, false, nil).and_return(@tempfile)
+ Chef::Provider::RemoteFile::FTP.should_receive(:fetch).with(URI.parse("ftp://opscode.com/seattle.txt"), false, nil).and_return(@tempfile)
@provider.run_action(:create)
end
it "should fetch with ftp in active mode" do
@resource.ftp_active_mode true
- Chef::Provider::RemoteFile::FTP.should_receive(:fetch).with(URI.parse("ftp://opscode.com/seattle.txt"), nil, true, nil).and_return(@tempfile)
+ Chef::Provider::RemoteFile::FTP.should_receive(:fetch).with(URI.parse("ftp://opscode.com/seattle.txt"), true, nil).and_return(@tempfile)
@provider.run_action(:create)
end
end