summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshley Penney <ashley.penney@puppetlabs.com>2013-07-09 12:22:18 -0400
committerAshley Penney <ashley.penney@puppetlabs.com>2013-07-09 12:22:18 -0400
commit19b140786a6483a02b96d60605dc257d3625d3b7 (patch)
treea1edd9b9bd23d23d5e38c5d93781a35a7eceaf24
parent626e988e636d1615f514e4e3eb58a8f0ae047e4a (diff)
Add some basic tests.
-rw-r--r--spec/system/basic_spec.rb25
-rw-r--r--spec/system/ntp_install_spec.rb11
2 files changed, 36 insertions, 0 deletions
diff --git a/spec/system/basic_spec.rb b/spec/system/basic_spec.rb
new file mode 100644
index 0000000..87fedd2
--- /dev/null
+++ b/spec/system/basic_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper_system'
+
+describe 'basic tests:' do
+ # Using puppet_apply as a subject
+ context puppet_apply 'notice("foo")' do
+ its(:stdout) { should =~ /foo/ }
+ its(:stderr) { should be_empty }
+ its(:exit_code) { should be_zero }
+ end
+
+ # Using puppet_apply as a helper
+ it 'my class should work with no errors' do
+ pp = <<-EOS
+ class { 'ntp': }
+ EOS
+
+ # Run it twice and test for idempotency
+ puppet_apply(pp) do |r|
+ r.exit_code.should_not == 1
+ r.refresh
+ r.exit_code.should be_zero
+ end
+ end
+end
+
diff --git a/spec/system/ntp_install_spec.rb b/spec/system/ntp_install_spec.rb
new file mode 100644
index 0000000..434cf58
--- /dev/null
+++ b/spec/system/ntp_install_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper_system'
+
+describe 'ntp::install class' do
+ let(:os) {
+ node.facts['osfamily']
+ }
+
+ describe package('ntp') do
+ it { should be_installed }
+ end
+end