mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/rake/test_{package_task,rules,task_manager}.rb: use
temporary directories. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f163275b5c
commit
59ad28c261
4 changed files with 34 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Mar 31 16:05:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* test/rake/test_{package_task,rules,task_manager}.rb: use
|
||||
temporary directories.
|
||||
|
||||
Wed Mar 31 13:53:13 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* test/rubygems/gemutilities.rb (setup, teardown):
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'tmpdir'
|
||||
require 'fileutils'
|
||||
require 'test/unit'
|
||||
require 'rake/packagetask'
|
||||
|
||||
|
@ -5,6 +7,11 @@ class Rake::TestPackageTask < Test::Unit::TestCase
|
|||
include Rake
|
||||
|
||||
def test_create
|
||||
pwd = Dir.pwd
|
||||
tmpdir = Dir.mktmpdir("rake")
|
||||
Dir.chdir(tmpdir)
|
||||
Dir.mkdir("bin")
|
||||
open("bin/rake", "wb") {}
|
||||
pkg = Rake::PackageTask.new("pkgr", "1.2.3") { |p|
|
||||
p.package_files << "install.rb"
|
||||
p.package_files.include(
|
||||
|
@ -35,6 +42,9 @@ class Rake::TestPackageTask < Test::Unit::TestCase
|
|||
assert Task["pkg/pkgr-1.2.3"]
|
||||
assert Task[:clobber_package]
|
||||
assert Task[:repackage]
|
||||
ensure
|
||||
Dir.chdir(pwd)
|
||||
FileUtils.rm_rf(tmpdir)
|
||||
end
|
||||
|
||||
def test_missing_version
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'test/unit'
|
||||
require 'tmpdir'
|
||||
require 'fileutils'
|
||||
require 'rake'
|
||||
require_relative 'filecreation'
|
||||
|
@ -16,12 +17,18 @@ class Rake::TestRules < Test::Unit::TestCase
|
|||
DOTFOOFILE = "testdata/.foo"
|
||||
|
||||
def setup
|
||||
@oldpwd = Dir.pwd
|
||||
@tmpdir = Dir.mktmpdir("rake")
|
||||
Dir.chdir(@tmpdir)
|
||||
Dir.mkdir("testdata")
|
||||
Task.clear
|
||||
@runs = []
|
||||
end
|
||||
|
||||
def teardown
|
||||
FileList['testdata/*'].uniq.each do |f| rm_r(f, :verbose=>false) end
|
||||
FileList['testdata/{*,.[^.]*,}'].uniq.each do |f| rm_r(f, :verbose=>false) end
|
||||
Dir.chdir(@oldpwd)
|
||||
Dir.rmdir(@tmpdir)
|
||||
end
|
||||
|
||||
def test_multiple_rules1
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
require 'test/unit'
|
||||
require 'fileutils'
|
||||
require 'tmpdir'
|
||||
require 'rake'
|
||||
|
||||
class Rake::TestTaskManager < Test::Unit::TestCase
|
||||
|
@ -7,7 +9,16 @@ class Rake::TestTaskManager < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def setup
|
||||
@oldpwd = Dir.pwd
|
||||
@tmpdir = Dir.mktmpdir("rake")
|
||||
Dir.chdir(@tmpdir)
|
||||
@tm = TaskManager.new
|
||||
open("README", "wb") {}
|
||||
end
|
||||
|
||||
def teardown
|
||||
Dir.chdir(@oldpwd)
|
||||
FileUtils.rm_rf(@tmpdir)
|
||||
end
|
||||
|
||||
def test_create_task_manager
|
||||
|
|
Loading…
Reference in a new issue