summaryrefslogtreecommitdiff
path: root/test/rake/test_rake_file_task.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-15 21:59:37 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-15 21:59:37 +0000
commit9c66bad9f3d522d50d4a45ef8a3a92abbf93229f (patch)
tree8fc1ae219e41bdd711442b1d35149da4f45dfa8a /test/rake/test_rake_file_task.rb
parentbfc95c6e1639edc909338ef4d20d990caf6f630e (diff)
* lib/rake*: Updated to rake 0.9.3
* test/rake*: ditto * bin/rake: ditto * NEWS: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake/test_rake_file_task.rb')
-rw-r--r--test/rake/test_rake_file_task.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/rake/test_rake_file_task.rb b/test/rake/test_rake_file_task.rb
index e586551237f..a46851bd01d 100644
--- a/test/rake/test_rake_file_task.rb
+++ b/test/rake/test_rake_file_task.rb
@@ -41,6 +41,23 @@ class TestRakeFileTask < Rake::TestCase
assert ! t1.needed?, "Should not need to rebuild new file because of old"
end
+ def test_file_times_new_depend_on_regular_task_timestamps
+ load_phony
+
+ name = "dummy"
+ task name
+
+ create_timed_files(NEWFILE)
+
+ t1 = Rake.application.intern(FileTask, NEWFILE).enhance([name])
+
+ assert t1.needed?, "depending on non-file task uses Time.now"
+
+ task(name => :phony)
+
+ assert ! t1.needed?, "unless the non-file task has a timestamp"
+ end
+
def test_file_times_old_depends_on_new
create_timed_files(OLDFILE, NEWFILE)
@@ -98,5 +115,8 @@ class TestRakeFileTask < Rake::TestCase
assert( ! File.exist?(NEWFILE), "NEWFILE should be deleted")
end
-end
+ def load_phony
+ load File.join(@orig_PWD, "lib/rake/phony.rb")
+ end
+end