summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Cooper <josh@puppetlabs.com>2014-09-02 11:19:11 -0700
committerJosh Cooper <josh@puppetlabs.com>2014-09-02 13:41:44 -0700
commit44174a0e0f0d6abdabda8da7cad68adeef233391 (patch)
tree11f7b4f8f80e18e3815dd0f24d1a0ec47e1dcf85
parent36faedd89ad5cb193c3e5d7e2571179808c3ee26 (diff)
downloadpuppet-44174a0e0f0d6abdabda8da7cad68adeef233391.tar.gz
(PUP-2349) Add windows specific expectation for deprecation_warning
Previously, the spec test assumed that no deprecation warnings would be issued. However, the test relies on puppet using the `source_permissions` of the source, and that behavior is deprecated on Windows. As a result, the test was failing on Windows. This commit updates the test to expect only the "Copying owner/mode/group/.." deprecation warning on Windows, and no deprecation warnings on other platforms.
-rwxr-xr-xspec/unit/type/file/source_spec.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/unit/type/file/source_spec.rb b/spec/unit/type/file/source_spec.rb
index 827fcc770..ff192a5f4 100755
--- a/spec/unit/type/file/source_spec.rb
+++ b/spec/unit/type/file/source_spec.rb
@@ -188,14 +188,22 @@ describe Puppet::Type.type(:file).attrclass(:source) do
it "should not issue a deprecation warning if the source mode value is a Numeric" do
@metadata.stubs(:mode).returns 0173
- Puppet.expects(:deprecation_warning).never
+ if Puppet::Util::Platform.windows?
+ Puppet.expects(:deprecation_warning).with(regexp_matches(/Copying owner\/mode\/group from the source file on Windows is deprecated/)).at_least_once
+ else
+ Puppet.expects(:deprecation_warning).never
+ end
@source.copy_source_values
end
it "should not issue a deprecation warning if the source mode value is a String" do
@metadata.stubs(:mode).returns "173"
- Puppet.expects(:deprecation_warning).never
+ if Puppet::Util::Platform.windows?
+ Puppet.expects(:deprecation_warning).with(regexp_matches(/Copying owner\/mode\/group from the source file on Windows is deprecated/)).at_least_once
+ else
+ Puppet.expects(:deprecation_warning).never
+ end
@source.copy_source_values
end