Sha256: 1d3d70625301de6427403da3429139b516ac7e590fc1ba0fdff4822a582d0da9

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

require 'support/shared_contexts/rake'

describe 'fluent-migrator' do
  include_context 'rake'

  let(:db_build_tasks) { %w(create drop migrate new_migration rebuild rollback seed setup try) }

  let(:db_specific_tasks) { db_build_tasks.map {|t| "db:mydatabase:#{t}" } }

  let(:build_tasks) { db_build_tasks.map {|t| "db:#{t}" } }

  it 'should create all of the db tasks' do
    build_tasks.each do |name|
      task_names.should include(name)
    end
  end

  it 'should create all of the db specific tasks' do
    db_specific_tasks.each do |name|
      task_names.should include(name)
    end
  end

  it 'should rebuild the database' do
    rake['db:rebuild'].invoke
  end
end

describe 'multiple-fluent-migrator' do
  include_context 'rake'

  let(:db_aliases) { %w(client server) }
  let(:build_tasks) { %w(create drop migrate new_migration rebuild rollback seed setup try) }
  let(:db_specific_tasks) { db_aliases.product(build_tasks).map {|db_alias, task| "db:#{db_alias}:#{task}"} }
  let(:global_tasks) { %w(db:create db:drop db:migrate db:rebuild db:seed db:setup) }

  it 'should create the global build tasks' do
    global_tasks.each do |name|
      task_names.should include(name)
    end
  end

  it 'should create the db specific tasks' do
    db_specific_tasks.each do |name|
      task_names.should include(name)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
physique-0.3.8 spec/task_builders/fluent_migrator_spec.rb
physique-0.3.7 spec/task_builders/fluent_migrator_spec.rb
physique-0.3.6 spec/task_builders/fluent_migrator_spec.rb
physique-0.3.5 spec/task_builders/fluent_migrator_spec.rb