From c323cea12a8f34b34953147b768cec0a4335b982 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Fri, 13 Mar 2015 13:44:59 -0700 Subject: [PATCH] Fix specs for #567 --- spec/unit/classes/server_spec.rb | 2 +- spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb | 2 +- .../puppet/provider/postgresql_replication_slot/ruby_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/unit/classes/server_spec.rb b/spec/unit/classes/server_spec.rb index c6be844..64df958 100644 --- a/spec/unit/classes/server_spec.rb +++ b/spec/unit/classes/server_spec.rb @@ -46,7 +46,7 @@ describe 'postgresql::server', :type => :class do "PGPASSWORD='new-p@s$word-to-set'", "NEWPASSWD_ESCAPED='$$new-p@s$word-to-set$$'" ], - 'unless' => "/usr/bin/psql -h localhost -c 'select 1' > /dev/null", + 'unless' => "/usr/bin/psql -h localhost -p 5432 -c 'select 1' > /dev/null", }) end end diff --git a/spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb b/spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb index 752162f..b21a326 100644 --- a/spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb +++ b/spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb @@ -73,7 +73,7 @@ describe Puppet::Type.type(:postgresql_psql).provider(:ruby) do it "executes with the given port" do expect(provider).to receive(:run_command).with(["psql", "-p", "5555", - "-t", "-c", "SELECT something"], + "-t", "-c", "\"SELECT something\""], "postgres", "postgres") provider.run_sql_command("SELECT something") diff --git a/spec/unit/puppet/provider/postgresql_replication_slot/ruby_spec.rb b/spec/unit/puppet/provider/postgresql_replication_slot/ruby_spec.rb index 69b63f3..4fc8b55 100644 --- a/spec/unit/puppet/provider/postgresql_replication_slot/ruby_spec.rb +++ b/spec/unit/puppet/provider/postgresql_replication_slot/ruby_spec.rb @@ -35,7 +35,7 @@ def | | physical | | | t | | | 0/ provider.class.expects(:run_command).with( ['psql', '-t', '-c', 'SELECT * FROM pg_replication_slots;'], 'postgres', 'postgres').returns([sql_instances, nil]) - instances = type.instances + instances = provider.class.instances expect(instances.size).to eq 2 expect(instances[0].name).to eq 'abc' expect(instances[1].name).to eq 'def'