Skip to content
Browse files

Fix filebucket specs on Windows

  • Loading branch information...
1 parent 36e92f2 commit 7e92a7c416f331d15424e22979471928f7603938 @pcarlisle committed Apr 30, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 spec/unit/type/filebucket_spec.rb
View
12 spec/unit/type/filebucket_spec.rb
@@ -2,6 +2,8 @@
require 'spec_helper'
describe Puppet::Type.type(:filebucket) do
+ include PuppetSpec::Files
+
describe "when validating attributes" do
%w{name server port path}.each do |attr|
it "should have a '#{attr}' parameter" do
@@ -36,8 +38,6 @@
end
describe "path" do
- include PuppetSpec::Files
-
def bucket(hash)
Puppet::Type.type(:filebucket).new({:name => 'main'}.merge(hash))
end
@@ -71,7 +71,7 @@ def bucket(hash)
end
it "be local if both a path and a server are specified" do
- bucket(:server => "puppet", :path => "/my/path").bucket.should be_local
+ bucket(:server => "puppet", :path => make_absolute("/my/path")).bucket.should be_local
end
end
@@ -81,10 +81,12 @@ def bucket(hash)
end
it "should use any provided path" do
- bucket = Puppet::Type.type(:filebucket).new :name => "main", :path => "/foo/bar"
- Puppet::FileBucket::Dipper.expects(:new).with(:Path => "/foo/bar").returns @bucket
+ path = make_absolute("/foo/bar")
+ bucket = Puppet::Type.type(:filebucket).new :name => "main", :path => path
+ Puppet::FileBucket::Dipper.expects(:new).with(:Path => path).returns @bucket
bucket.bucket
end
+
it "should use any provided server and port" do
bucket = Puppet::Type.type(:filebucket).new :name => "main", :server => "myserv", :port => "myport", :path => false
Puppet::FileBucket::Dipper.expects(:new).with(:Server => "myserv", :Port => "myport").returns @bucket

0 comments on commit 7e92a7c

Please sign in to comment.
Something went wrong with that request. Please try again.