aboutsummaryrefslogtreecommitdiffstats
path: root/spec/dbshell/client/mysql_spec.rb
diff options
context:
space:
mode:
authorTeddy Wing2017-04-29 22:49:10 +0200
committerTeddy Wing2017-04-29 22:49:10 +0200
commit575141e4efc770a4207eb5d905819d4017731f65 (patch)
treeccd831bf10830d20cf348042b1e1ce244e9d4d9e /spec/dbshell/client/mysql_spec.rb
parent3c5729137d4ea81c607bfc9422ceaeb1056081c5 (diff)
downloaddbshell-rails-575141e4efc770a4207eb5d905819d4017731f65.tar.bz2
Add `DBShell::Client::MySQL`
For now only includes a `.build_command()` method. Inspired again by: https://github.com/django/django/blob/66150f7cf61bc09547fa98586790df596eff6d77/django/db/backends/mysql/client.py although in our case we haven't handled some of the more exotic options. Eventually we'll probably have to do that.
Diffstat (limited to 'spec/dbshell/client/mysql_spec.rb')
-rw-r--r--spec/dbshell/client/mysql_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/dbshell/client/mysql_spec.rb b/spec/dbshell/client/mysql_spec.rb
new file mode 100644
index 0000000..c98203e
--- /dev/null
+++ b/spec/dbshell/client/mysql_spec.rb
@@ -0,0 +1,24 @@
+require 'minitest/autorun'
+require 'dbshell/client/mysql'
+
+describe DBShell::Client::MySQL do
+ describe ".build_command" do
+ it "builds basic arguments" do
+ DBShell::Client::MySQL.build_command({
+ 'adapter' => 'mysql2',
+ 'host' => 'mailmarehost',
+ 'port' => 6027,
+ 'username' => 'derpyhooves',
+ 'password' => 'somepassword',
+ 'database' => 'dbname'
+ }).must_equal([
+ 'mysql',
+ '--user=derpyhooves',
+ '--password=somepassword',
+ '--host=mailmarehost',
+ '--port=6027',
+ 'dbname'
+ ])
+ end
+ end
+end