Skip to content

Commit

Permalink
Fix filebucket specs on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarlisle committed Apr 30, 2012
1 parent 36e92f2 commit 7e92a7c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions spec/unit/type/filebucket_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
require 'spec_helper' require 'spec_helper'


describe Puppet::Type.type(:filebucket) do describe Puppet::Type.type(:filebucket) do
include PuppetSpec::Files

describe "when validating attributes" do describe "when validating attributes" do
%w{name server port path}.each do |attr| %w{name server port path}.each do |attr|
it "should have a '#{attr}' parameter" do it "should have a '#{attr}' parameter" do
Expand Down Expand Up @@ -36,8 +38,6 @@
end end


describe "path" do describe "path" do
include PuppetSpec::Files

def bucket(hash) def bucket(hash)
Puppet::Type.type(:filebucket).new({:name => 'main'}.merge(hash)) Puppet::Type.type(:filebucket).new({:name => 'main'}.merge(hash))
end end
Expand Down Expand Up @@ -71,7 +71,7 @@ def bucket(hash)
end end


it "be local if both a path and a server are specified" do 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
end end


Expand All @@ -81,10 +81,12 @@ def bucket(hash)
end end


it "should use any provided path" do it "should use any provided path" do
bucket = Puppet::Type.type(:filebucket).new :name => "main", :path => "/foo/bar" path = make_absolute("/foo/bar")
Puppet::FileBucket::Dipper.expects(:new).with(:Path => "/foo/bar").returns @bucket bucket = Puppet::Type.type(:filebucket).new :name => "main", :path => path
Puppet::FileBucket::Dipper.expects(:new).with(:Path => path).returns @bucket
bucket.bucket bucket.bucket
end end

it "should use any provided server and port" do it "should use any provided server and port" do
bucket = Puppet::Type.type(:filebucket).new :name => "main", :server => "myserv", :port => "myport", :path => false 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 Puppet::FileBucket::Dipper.expects(:new).with(:Server => "myserv", :Port => "myport").returns @bucket
Expand Down

0 comments on commit 7e92a7c

Please sign in to comment.