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