Browse Source

beaker: add some more basic tests

Matthew Haughton 9 years ago
parent
commit
78218ac8c7

+ 1 - 0
spec/acceptance/class_spec.rb

@@ -18,6 +18,7 @@ describe "nginx class:" do
 
   describe service('nginx') do
     it { is_expected.to be_running }
+    it { is_expected.to be_enabled }
   end
 
 end

+ 11 - 0
spec/acceptance/nginx_mail_spec.rb

@@ -12,7 +12,10 @@ describe "nginx::resource::mailhost define:" do
       auth_http   => 'localhost/cgi-bin/auth',
       protocol    => 'smtp',
       listen_port => 587,
+      ssl         => true,
       ssl_port    => 465,
+      ssl_cert    => '/tmp/blah.cert',
+      ssl_key     => '/tmp/blah.key',
       xclient     => 'off',
     }
     "
@@ -25,4 +28,12 @@ describe "nginx::resource::mailhost define:" do
    it { is_expected.to contain "auth_http             localhost/cgi-bin/auth;" }
   end
 
+  describe port(587) do
+    it { is_expected.to be_listening }
+  end
+
+  describe port(465) do
+    it { is_expected.to be_listening }
+  end
+
 end

+ 8 - 0
spec/acceptance/nginx_vhost_spec.rb

@@ -30,6 +30,10 @@ describe "nginx::resource::vhost define:" do
     describe service('nginx') do
       it { is_expected.to be_running }
     end
+    
+    describe port(80) do
+      it { is_expected.to be_listening }
+    end
 
     it 'should answer to www.puppetlabs.com' do
       shell("/usr/bin/curl http://www.puppetlabs.com:80") do |r|
@@ -72,6 +76,10 @@ describe "nginx::resource::vhost define:" do
       it { is_expected.to be_running }
     end
 
+    describe port(443) do
+      it { is_expected.to be_listening }
+    end
+
     it 'should answer to http://www.puppetlabs.com' do
       shell("/usr/bin/curl http://www.puppetlabs.com:80") do |r|
         expect(r.stdout).to eq("Hello from www\n")