summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAdrien Thebo <git@somethingsinistral.net>2013-03-08 09:19:59 -0800
committerAdrien Thebo <git@somethingsinistral.net>2013-03-08 09:19:59 -0800
commitb1b3132f84d1628800e50a65f6c49bb998872acc (patch)
tree4e55fbfaa5407c1019418d9e3913718c65bd241d /spec
parentfd064cbdf39bf12794e4c6733b188a077a47a214 (diff)
parent9968350db2343272068601bf5709c2548bc73eb7 (diff)
Merge pull request #47 from frimik/feature-19418-ntp-template
ntp: fixes #19418 - allow template override
Diffstat (limited to 'spec')
-rw-r--r--spec/classes/ntp_spec.rb6
-rw-r--r--spec/fixtures/modules/my_ntp/templates/ntp.conf.erb4
2 files changed, 10 insertions, 0 deletions
diff --git a/spec/classes/ntp_spec.rb b/spec/classes/ntp_spec.rb
index e74f7c1..9ce690b 100644
--- a/spec/classes/ntp_spec.rb
+++ b/spec/classes/ntp_spec.rb
@@ -128,6 +128,12 @@ describe 'ntp' do
params[:autoupdate] = true
subject.should contain_package('ntp').with_ensure('latest')
end
+ it 'should allow template to be overridden' do
+ params[:config_template] = 'my_ntp/ntp.conf.erb'
+ content = param_value(subject, 'file', '/etc/ntp.conf', 'content')
+ expected_lines = ['server foobar']
+ (content.split("\n") & expected_lines).should == expected_lines
+ end
end
end
end
diff --git a/spec/fixtures/modules/my_ntp/templates/ntp.conf.erb b/spec/fixtures/modules/my_ntp/templates/ntp.conf.erb
new file mode 100644
index 0000000..40cf67c
--- /dev/null
+++ b/spec/fixtures/modules/my_ntp/templates/ntp.conf.erb
@@ -0,0 +1,4 @@
+#my uber ntp config
+#
+
+server foobar