diff options
| author | Josh Cooper <josh@puppetlabs.com> | 2011-07-18 23:05:35 -0700 |
|---|---|---|
| committer | Josh Cooper <josh@puppetlabs.com> | 2011-07-19 14:06:36 -0700 |
| commit | 462a95e3d077b1915a919399b846068816c84583 (patch) | |
| tree | f2e260c6d923d49f20a3d6094796aae36ec240fe /spec/unit/configurer | |
| parent | 45ae5b4a9ced26dfcd3e324391f9a26cb02bf93d (diff) | |
| download | puppet-462a95e3d077b1915a919399b846068816c84583.tar.gz puppet-462a95e3d077b1915a919399b846068816c84583.tar.xz puppet-462a95e3d077b1915a919399b846068816c84583.zip | |
Fix tests with "relative" paths on Windows
Absolute paths on Unix, e.g. /foo/bar, are not absolute on Windows,
which breaks many test cases. This commit adds a method to
PuppetSpec::Files.make_absolute that makes the path absolute in
test cases.
On Unix (Puppet.features.posix?) it is a no-op. On Windows,
(Puppet.features.microsoft_windows?) the drive from the current
working directory is prepended.
Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
Diffstat (limited to 'spec/unit/configurer')
| -rwxr-xr-x | spec/unit/configurer/downloader_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/unit/configurer/downloader_spec.rb b/spec/unit/configurer/downloader_spec.rb index 17b285d53..1ffea9b7a 100755 --- a/spec/unit/configurer/downloader_spec.rb +++ b/spec/unit/configurer/downloader_spec.rb @@ -97,14 +97,15 @@ describe Puppet::Configurer::Downloader do describe "when creating the catalog to do the downloading" do before do - @dler = Puppet::Configurer::Downloader.new("foo", "/download/path", "source") + @path = make_absolute("/download/path") + @dler = Puppet::Configurer::Downloader.new("foo", @path, "source") end it "should create a catalog and add the file to it" do catalog = @dler.catalog catalog.resources.size.should == 1 catalog.resources.first.class.should == Puppet::Type::File - catalog.resources.first.name.should == "/download/path" + catalog.resources.first.name.should == @path end it "should specify that it is not managing a host catalog" do |
