spec/unit/migration_tasks_spec.rb in rom-sql-0.6.1 vs spec/unit/migration_tasks_spec.rb in rom-sql-0.7.0.beta1

- old
+ new

@@ -1,19 +1,20 @@ require 'spec_helper' namespace :db do - task :setup do - # noop + task :setup do + #noop end end describe 'MigrationTasks' do + let(:configuration) { ROM::Configuration.new(:sql, DB_URI) } + let!(:container) { ROM.container(configuration) } + let(:migrator) { container.gateways[:default].migrator } + before do - ROM.setup(:sql, ['postgres://localhost/rom']) - ROM.finalize + ROM::SQL::RakeSupport.stub(:env) { configuration } end - - let(:migrator) { ROM.env.gateways[:default].migrator } context 'db:reset' do it 'calls proper commands' do expect(migrator).to receive(:run).with(target: 0) expect(migrator).to receive(:run)