diff options
author | Josh Cooper <josh@puppetlabs.com> | 2014-09-02 11:19:11 -0700 |
---|---|---|
committer | Josh Cooper <josh@puppetlabs.com> | 2014-09-02 13:43:55 -0700 |
commit | b4dd0b227ce18da3349ce54113f0e1018e44f890 (patch) | |
tree | 11f7b4f8f80e18e3815dd0f24d1a0ec47e1dcf85 | |
parent | 36faedd89ad5cb193c3e5d7e2571179808c3ee26 (diff) | |
download | puppet-b4dd0b227ce18da3349ce54113f0e1018e44f890.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.
Reviewed-by: Josh Partlow <joshua.partlow@puppetlabs.com>
-rwxr-xr-x | spec/unit/type/file/source_spec.rb | 12 |
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 |