Skip to content

Commit b6a4d23

Browse files
committed
Tries to add proper acceptance and unit test
1 parent 133ee67 commit b6a4d23

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

spec/acceptance/alternative_pgdata_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ class { 'postgresql::server': datadir => '/var/pgsql' }
1111
apply_manifest(pp, :catch_failures => true)
1212
apply_manifest(pp, :catch_changes => true)
1313
end
14+
15+
describe "Alternate Directory" do
16+
File.directory?("/var/pgsql").should be true
17+
end
1418

1519
it 'can connect with psql' do
1620
psql('--command="\l" postgres', 'postgres') do |r|

spec/unit/defines/server/config_entry_spec.rb

+9
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@
8888
end
8989
end
9090

91+
context "data_directory" do
92+
let(:params) {{ :ensure => 'present', :name => 'data_directory', :value => '/var/pgsql' }}
93+
94+
it 'stops postgresql and changes the data directory' do
95+
is_expected.to contain_exec('postgresql_data_directory')
96+
is_expected.to contain_augeas('override PGDATA in /etc/sysconfig/pgsql/postgresql')
97+
end
98+
end
99+
91100
context "passes values through appropriately" do
92101
let(:params) {{ :ensure => 'present', :name => 'check_function_bodies', :value => 'off' }}
93102

0 commit comments

Comments
 (0)