spec/lib/dbcp/database_spec.rb in dbcp-0.0.1 vs spec/lib/dbcp/database_spec.rb in dbcp-0.1.0
- old
+ new
@@ -1,14 +1,18 @@
require 'spec_helper'
describe Dbcp::Database do
describe ".build" do
- context "valid type" do
+ context "supported type" do
specify { expect(Dbcp::Database.build 'adapter' => 'postgresql').to be_a(Dbcp::PostgresDatabase) }
end
- context "invalid type" do
- specify { expect { Dbcp::Database.build 'adapter' => 'invalid'}.to raise_error(Dbcp::Database::UnsupportedDatabaseAdapter) }
+ context "no type" do
+ specify { expect { Dbcp::Database.build 'adapter' => nil}.to raise_error(Dbcp::Database::BlankDatabaseDefinition) }
+ end
+
+ context "unsupported type" do
+ specify { expect { Dbcp::Database.build 'adapter' => 'unsupported'}.to raise_error(Dbcp::Database::UnsupportedDatabaseAdapter) }
end
end
end