aboutsummaryrefslogtreecommitdiffstats
path: root/spec/dbshell/postgres_client_spec.rb
blob: 0773778e8fd683668d66d00567a9869f3165ede3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'minitest/autorun'
require 'dbshell/postgres_client'

describe DBShell::PostgresClient do
  describe ".build_command" do
    it "builds basic arguments" do
      DBShell::PostgresClient.build_command({
        'adapter' => 'postgresql',
        'host' => 'mailmarehost',
        'port' => 6027,
        'username' => 'derpyhooves',
        'password' => 'somepassword',
        'database' => 'dbname'
      }).must_equal([
        'psql',
        '-U',
        'derpyhooves',
        '-h',
        'mailmarehost',
        '-p',
        '6027',
        'dbname'
      ])
    end
  end
end