|
13 | 13 |
|
14 | 14 | it 'executes with the given psql_path on the given DB' do
|
15 | 15 | expect(provider).to receive(:run_command).with(['psql', '-d',
|
16 |
| - attributes[:db], '-t', '-c', '"SELECT \'something\' as \"Custom column\""'], 'postgres', |
| 16 | + attributes[:db], '-t', '-X', '-c', '"SELECT \'something\' as \"Custom column\""'], 'postgres', |
17 | 17 | 'postgres', {})
|
18 | 18 |
|
19 | 19 | provider.run_sql_command('SELECT \'something\' as "Custom column"')
|
|
33 | 33 | it 'executes with the given psql_path on the given DB' do
|
34 | 34 | expect(Dir).to receive(:chdir).with(attributes[:cwd]).and_yield
|
35 | 35 | expect(provider).to receive(:run_command).with([attributes[:psql_path],
|
36 |
| - '-d', attributes[:db], '-t', '-c', '"SELECT \'something\' as \"Custom column\""'], |
| 36 | + '-d', attributes[:db], '-t', '-X', '-c', '"SELECT \'something\' as \"Custom column\""'], |
37 | 37 | attributes[:psql_user], attributes[:psql_group], {})
|
38 | 38 |
|
39 | 39 | provider.run_sql_command('SELECT \'something\' as "Custom column"')
|
|
47 | 47 | end
|
48 | 48 |
|
49 | 49 | it 'executes with the given search_path' do
|
50 |
| - expect(provider).to receive(:run_command).with(['psql', '-t', '-c', |
| 50 | + expect(provider).to receive(:run_command).with(['psql', '-t', '-X', '-c', |
51 | 51 | '"set search_path to schema1; SELECT \'something\' as \"Custom column\""'],
|
52 | 52 | 'postgres', 'postgres', {})
|
53 | 53 |
|
|
62 | 62 | end
|
63 | 63 |
|
64 | 64 | it 'executes with the given search_path' do
|
65 |
| - expect(provider).to receive(:run_command).with(['psql', '-t', '-c', |
| 65 | + expect(provider).to receive(:run_command).with(['psql', '-t', '-X', '-c', |
66 | 66 | '"set search_path to schema1,schema2; SELECT \'something\' as \"Custom column\""'],
|
67 | 67 | 'postgres', 'postgres',
|
68 | 68 | {})
|
|
77 | 77 | it 'executes with the given port' do
|
78 | 78 | expect(provider).to receive(:run_command).with(['psql',
|
79 | 79 | '-p', '5555',
|
80 |
| - '-t', '-c', '"SELECT something"'], |
| 80 | + '-t', '-X', '-c', '"SELECT something"'], |
81 | 81 | 'postgres', 'postgres', {})
|
82 | 82 |
|
83 | 83 | provider.run_sql_command('SELECT something')
|
|
88 | 88 |
|
89 | 89 | it 'executes with the given host' do
|
90 | 90 | expect(provider).to receive(:run_command).with(['psql',
|
91 |
| - '-t', '-c', |
| 91 | + '-t', '-X', '-c', |
92 | 92 | '"SELECT something"'],
|
93 | 93 | 'postgres', 'postgres', 'PGHOST' => '127.0.0.1')
|
94 | 94 |
|
|
0 commit comments