-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for a connection before running db.create task (#397)
* Updated db.create task to check for a connection first before running the create. * clean up code with already built in Process runner * rename alias for clarity. Moved connection to private method
- Loading branch information
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require "../spec_helper" | ||
|
||
describe Db::Create do | ||
it "raises a connection error when unable to connect" do | ||
Avram.temp_config(database_to_migrate: DatabaseWithIncorrectSettings) do | ||
expect_raises(Avram::ConnectionError, /Failed to connect to database/) do | ||
Db::Create.new(quiet: true).call | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters