spec/shared/database.rb in rom-repository-0.1.0 vs spec/shared/database.rb in rom-repository-0.2.0.beta1
- old
+ new
@@ -1,11 +1,13 @@
RSpec.shared_context 'database' do
- let(:setup) { ROM.setup(:sql, uri) }
- let(:conn) { setup.gateways[:default].connection }
- let(:rom) { setup.finalize }
+ let(:configuration) { ROM::Configuration.new(:sql, uri).use(:macros) }
+ let(:conn) { configuration.gateways[:default].connection }
+ let(:rom) { ROM.container(configuration) }
let(:uri) { 'postgres://localhost/rom_repository' }
before do
+ conn.loggers << LOGGER
+
[:tags, :tasks, :users].each { |table| conn.drop_table?(table) }
conn.create_table :users do
primary_key :id
column :name, String