Sha256: 734b5215ebfdec568124eb172edd54556e757be2703e713870b013b2a38ed577

Contents?: true

Size: 1.19 KB

Versions: 88

Compression:

Stored size: 1.19 KB

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb')
require 'rbbt-util'
require 'rbbt/util/migrate'

class TestMigrate < Test::Unit::TestCase
  def _test_source_locate
    assert_equal 'var/jobs/', Rbbt.migrate_source_paths(Rbbt.root['var/jobs'].find(:user)).last
    assert Rbbt.migrate_source_paths(Rbbt.root['var/jobs'].find(:user))[1].include?(File.join(ENV["HOME"], '.rbbt/var/jobs/'))
  end

  def test_migrate
    Open.rm_rf Rbbt.tmp.test.migration_test.find(:user)
    test_file = Rbbt.tmp.test.migration_test.migration_test_file.find(:user)
    Open.write(test_file, "TEST")
    TmpFile.with_file do |tmpdir|
      Misc.in_dir tmpdir do
        Log.with_severity 0 do
          Rbbt.migrate('tmp/test/migration_test/migration_test_file', :current)
        end
      end
      assert_equal "TEST", Open.read(File.join(tmpdir, 'tmp/test/migration_test/migration_test_file'))
    end
  end

  def __test_migrate_turbo
    Log.with_severity 0 do
    TmpFile.with_file do |tmpdir|
      Misc.in_dir tmpdir do
        Rbbt.migrate('etc/config', :current, :source => 'mn1')
      end
      assert_equal "TEST", Open.read(File.join(tmpdir, 'etc/config'))
    end
    end
  end
end

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
rbbt-util-5.38.1 test/rbbt/util/test_migrate.rb
rbbt-util-5.38.0 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.16 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.15 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.14 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.13 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.12 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.11 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.10 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.9 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.8 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.6 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.4 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.3 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.1 test/rbbt/util/test_migrate.rb
rbbt-util-5.37.0 test/rbbt/util/test_migrate.rb
rbbt-util-5.36.0 test/rbbt/util/test_migrate.rb
rbbt-util-5.35.4 test/rbbt/util/test_migrate.rb
rbbt-util-5.35.3 test/rbbt/util/test_migrate.rb
rbbt-util-5.35.2 test/rbbt/util/test_migrate.rb