summaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-05-06 11:08:35 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-05-06 11:08:35 -0700
commitf80afbe72b848fe4ed81d8116d4eeb494aa6f61e (patch)
tree73c7f27f2ea2fb1668f7067ce05638f5064f540d /spec/integration
parent1b12b55b6a2d3581f9643bf09d55727ba1213580 (diff)
parentb983386ece1b9816e6d3d59a316ad589e35773df (diff)
Merge branch '2.7.x' into 2.7.next
Conflicts: * spec/unit/node/facts_spec.rb Updates: * spec/unit/interface/action{,_builder}_spec.rb => update for 'when_invoked' block being required.
Diffstat (limited to 'spec/integration')
-rwxr-xr-xspec/integration/application/doc_spec.rb4
-rwxr-xr-xspec/integration/faces/documentation_spec.rb55
-rwxr-xr-xspec/integration/transaction_spec.rb4
3 files changed, 59 insertions, 4 deletions
diff --git a/spec/integration/application/doc_spec.rb b/spec/integration/application/doc_spec.rb
index df9b91608..c1e463033 100755
--- a/spec/integration/application/doc_spec.rb
+++ b/spec/integration/application/doc_spec.rb
@@ -36,8 +36,8 @@ describe Puppet::Application::Doc do
Puppet[:modulepath] = modules_dir
Puppet[:manifest] = site_file
puppet.options[:mode] = :rdoc
- puppet.expects(:exit).with(0)
- puppet.run_command
+
+ expect { puppet.run_command }.to exit_with 0
File.should be_exist('doc')
ensure
diff --git a/spec/integration/faces/documentation_spec.rb b/spec/integration/faces/documentation_spec.rb
new file mode 100755
index 000000000..9ddf2f1b3
--- /dev/null
+++ b/spec/integration/faces/documentation_spec.rb
@@ -0,0 +1,55 @@
+#!/usr/bin/env rspec
+require 'spec_helper'
+require 'puppet/face'
+
+describe "documentation of faces" do
+ it "should generate global help" do
+ help = nil
+ expect { help = Puppet::Face[:help, :current].help }.not_to raise_error
+ help.should be_an_instance_of String
+ help.length.should be > 200
+ end
+
+ ########################################################################
+ # Can we actually generate documentation for the face, and the actions it
+ # has? This avoids situations where the ERB template turns out to have a
+ # bug in it, triggered in something the user might do.
+ Puppet::Face.faces.sort.each do |face_name|
+ # REVISIT: We should walk all versions of the face here...
+ let :help do Puppet::Face[:help, :current] end
+
+ context "generating help" do
+ it "for #{face_name}" do
+ expect {
+ text = help.help(face_name)
+ text.should be_an_instance_of String
+ text.length.should be > 100
+ }.not_to raise_error
+ end
+
+ Puppet::Face[face_name, :current].actions.sort.each do |action_name|
+ it "for #{face_name}.#{action_name}" do
+ expect {
+ text = help.help(face_name, action_name)
+ text.should be_an_instance_of String
+ text.length.should be > 100
+ }.not_to raise_error
+ end
+ end
+ end
+
+ ########################################################################
+ # Ensure that we have authorship and copyright information in *our* faces;
+ # if you apply this to third party faces you might well be disappointed.
+ context "licensing of Puppet Labs face '#{face_name}'" do
+ subject { Puppet::Face[face_name, :current] }
+ its :license do should =~ /Apache\s*2/ end
+ its :copyright do should =~ /Puppet Labs/ end
+
+ # REVISIT: This is less that ideal, I think, but right now I am more
+ # comfortable watching us ship with some copyright than without any; we
+ # can redress that when it becomes appropriate. --daniel 2011-04-27
+ its :copyright do should =~ /2011/ end
+ end
+ end
+end
diff --git a/spec/integration/transaction_spec.rb b/spec/integration/transaction_spec.rb
index 78d62fc51..0ff50f47c 100755
--- a/spec/integration/transaction_spec.rb
+++ b/spec/integration/transaction_spec.rb
@@ -275,7 +275,7 @@ describe Puppet::Transaction do
it "should not attempt to evaluate resources with failed dependencies" do
exec = Puppet::Type.type(:exec).new(
- :command => "/bin/mkdir /this/path/cannot/possibly/exit",
+ :command => "/bin/mkdir /this/path/cannot/possibly/exist",
:title => "mkdir"
)
@@ -309,7 +309,7 @@ describe Puppet::Transaction do
)
exec = Puppet::Type.type(:exec).new(
- :command => "/bin/mkdir /this/path/cannot/possibly/exit",
+ :command => "/bin/mkdir /this/path/cannot/possibly/exist",
:title => "mkdir",
:notify => create_file1
)