Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added lighttpd::dotconf spec tests

  • Loading branch information...
commit 1f93eed586bfcaf45aa4be21744cd70f4cd6faef 1 parent 17e923d
@alvagante alvagante authored
View
28 spec/defines/lighttpd_dotconf_spec.rb
@@ -0,0 +1,28 @@
+require "#{File.join(File.dirname(__FILE__),'..','spec_helper.rb')}"
+
+describe 'lighttpd::dotconf' do
+
+ let(:title) { 'lighttpd::dotconf' }
+ let(:node) { 'rspec.example42.com' }
+ let(:facts) { { :arch => 'i386' , :operatingsystem => 'redhat' } }
+ let(:params) {
+ { 'ensure' => 'present',
+ 'name' => 'www.example42.com',
+ 'source' => 'puppet:///modules/site/lighttpd/www.example42.com.conf',
+ }
+ }
+
+ describe 'Test lighttpd::dotconf' do
+ it 'should create a lighttpd::dotconf' do
+ should contain_file('Lighttpd_www.example42.com.conf').with_ensure('present')
+ end
+ end
+
+ describe 'Test lighttpd::dotconf source parameter' do
+ it 'should create a lighttpd::dotconf' do
+ content = catalogue.resource('file', 'Lighttpd_www.example42.com.conf').send(:parameters)[:source]
+ content.should == "puppet:///modules/site/lighttpd/www.example42.com.conf"
+ end
+ end
+
+end
View
3  spec/spec_helper.rb
@@ -18,7 +18,8 @@
c.filter_run_excluding :broken => true
c.after :each do
- FileUtils.remove_entry_secure(@puppetdir)
+ FileUtils.rm_rf(Dir.glob('/tmp/lighttpd20*') , :secure => true)
+# FileUtils.remove_entry_secure(@puppetdir)
end
c.module_path = File.join(File.dirname(__FILE__), '../../')
View
5 templates/spec.erb
@@ -4,5 +4,6 @@
<%= scope.to_hash.reject { |k,v| !( k.is_a?(String) && v.is_a?(String) ) }.to_yaml %>
# Custom Options
-<%= options['opt_a'] %>
-<%= options['opt_b'] %>
+opt_a = <%= scope.function_options_lookup(['opt_a','default_a']) %>
+opt_b = <%= scope.function_options_lookup(['opt_b','default_b']) %>
+opt_c = <%= scope.function_options_lookup(['opt_c','default_c']) %>

0 comments on commit 1f93eed

Please sign in to comment.
Something went wrong with that request. Please try again.