summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2011-04-28 00:44:43 +0200
committerDaniel Pittman <daniel@puppetlabs.com>2011-05-03 12:16:50 -0700
commit45adc1a1e482be74d2db9f97e7a4d3be5834ccf2 (patch)
treee99c719a2c1db42c409282a7e21aab04684f7006 /spec
parentd4df6cc2274e119fb2a67bca0912667b0fef7866 (diff)
downloadpuppet-45adc1a1e482be74d2db9f97e7a4d3be5834ccf2.tar.gz
puppet-45adc1a1e482be74d2db9f97e7a4d3be5834ccf2.tar.xz
puppet-45adc1a1e482be74d2db9f97e7a4d3be5834ccf2.zip
(#7279) Adding some basic file actions
Add the ability to download a file into the local filebucket using a puppet URI or from disk. Also, the ability to store into the filebucket. These provide at least basic UI for moving data around using the filebucket service, and act as an example of how further work can be done. Also, update the code to eliminate a couple of redundant checks on arguments, and add some basic testing around the actions. Mostly only that they exist, at this point. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/shared_behaviours/an_indirector_face.rb6
-rwxr-xr-xspec/unit/face/file_spec.rb7
2 files changed, 12 insertions, 1 deletions
diff --git a/spec/shared_behaviours/an_indirector_face.rb b/spec/shared_behaviours/an_indirector_face.rb
new file mode 100644
index 000000000..cba74b696
--- /dev/null
+++ b/spec/shared_behaviours/an_indirector_face.rb
@@ -0,0 +1,6 @@
+shared_examples_for "an indirector face" do
+ [:find, :search, :save, :destroy, :info].each do |action|
+ it { should be_action action }
+ it { should respond_to action }
+ end
+end
diff --git a/spec/unit/face/file_spec.rb b/spec/unit/face/file_spec.rb
index a362923e3..c3f05720f 100755
--- a/spec/unit/face/file_spec.rb
+++ b/spec/unit/face/file_spec.rb
@@ -3,5 +3,10 @@ require 'spec_helper'
require 'puppet/face'
describe Puppet::Face[:file, '0.0.1'] do
- it "should actually have some tests..."
+ it_should_behave_like "an indirector face"
+
+ [:download, :store].each do |action|
+ it { should be_action action }
+ it { should respond_to action }
+ end
end