summaryrefslogtreecommitdiff
path: root/test/rake/test_rake_task_manager.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-15 03:07:37 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-15 03:07:37 +0000
commit6361928083d01906ab9d8782b6533b4ed7c834a0 (patch)
tree172488be8a74c9313d35b9cd7d53999cd55f561d /test/rake/test_rake_task_manager.rb
parent031e1570b934d6b3a1e17ae8eb78a44dac8186d3 (diff)
* lib/rake.rb, lib/rake/*.rb: Upgrade to rake-10.3.2
[fix GH-668] * test/rake/*.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake/test_rake_task_manager.rb')
-rw-r--r--test/rake/test_rake_task_manager.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/rake/test_rake_task_manager.rb b/test/rake/test_rake_task_manager.rb
index 5ec4c0e..c2730b6 100644
--- a/test/rake/test_rake_task_manager.rb
+++ b/test/rake/test_rake_task_manager.rb
@@ -40,6 +40,23 @@ class TestRakeTaskManager < Rake::TestCase
assert_equal ["x:t"], @tm.tasks.map { |t| t.name }
end
+ def test_define_namespaced_task
+ t = @tm.define_task(Rake::Task, 'n:a:m:e:t')
+ assert_equal Rake::Scope.make("e", "m", "a", "n"), t.scope
+ assert_equal "n:a:m:e:t", t.name
+ assert_equal @tm, t.application
+ end
+
+ def test_define_namespace_in_namespace
+ t = nil
+ @tm.in_namespace("n") do
+ t = @tm.define_task(Rake::Task, 'a:m:e:t')
+ end
+ assert_equal Rake::Scope.make("e", "m", "a", "n"), t.scope
+ assert_equal "n:a:m:e:t", t.name
+ assert_equal @tm, t.application
+ end
+
def test_anonymous_namespace
anon_ns = @tm.in_namespace(nil) do
t = @tm.define_task(Rake::Task, :t)
@@ -89,6 +106,7 @@ class TestRakeTaskManager < Rake::TestCase
@tm.in_namespace("a") do
aa = @tm.define_task(Rake::Task, :aa)
mid_z = @tm.define_task(Rake::Task, :z)
+ ns_d = @tm.define_task(Rake::Task, "n:t")
@tm.in_namespace("b") do
bb = @tm.define_task(Rake::Task, :bb)
bot_z = @tm.define_task(Rake::Task, :z)
@@ -116,6 +134,8 @@ class TestRakeTaskManager < Rake::TestCase
assert_equal top_z, @tm["^z"]
assert_equal top_z, @tm["^^z"] # Over the top
assert_equal top_z, @tm["rake:z"]
+ assert_equal ns_d, @tm["n:t"]
+ assert_equal ns_d, @tm["a:n:t"]
end
assert_equal Rake::Scope.make, @tm.current_scope