summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-02-01 14:37:34 -0800
committerJacob Helwig <jacob@puppetlabs.com>2011-02-01 14:37:34 -0800
commit6c93eb2c142e346077c49ef78a5fcf675eeb2698 (patch)
treed209699fce5781205c7ab9e86fa646eba3e4d26a /spec/unit
parentf135a6436084629d47c6b3b590dadb14952e4d69 (diff)
Remove order dependency when specifying source and checksum on File type
If source was specified after setting the checksum, it would cause the checksum to be set back to :md5. This was completely unnecessary, because the checksum has its own default of :md5. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/type/file_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/type/file_spec.rb b/spec/unit/type/file_spec.rb
index db0fa9f34..944bd6bac 100755
--- a/spec/unit/type/file_spec.rb
+++ b/spec/unit/type/file_spec.rb
@@ -1096,4 +1096,19 @@ describe Puppet::Type.type(:file) do
File.exists?(@path).should == true
end
end
+
+ describe "when specifying both source and checksum" do
+ it 'should use the specified checksum when source is first' do
+ @file[:source] = '/foo'
+ @file[:checksum] = :md5lite
+
+ @file[:checksum].should be :md5lite
+ end
+ it 'should use the specified checksum when source is last' do
+ @file[:checksum] = :md5lite
+ @file[:source] = '/foo'
+
+ @file[:checksum].should be :md5lite
+ end
+ end
end