summaryrefslogtreecommitdiff
path: root/test/rake/test_rake_top_level_functions.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-04 12:31:31 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-04 12:31:31 +0000
commitc4ee0df8ba2cf7cc6aaa785c8df20a91b1719021 (patch)
tree06beca468cce4a75a3e9890d18aa001ef2c41e54 /test/rake/test_rake_top_level_functions.rb
parent8c0b2a286080609613b6b007e030ff7c7adaa23c (diff)
* lib/rake/*: Gemify rake [fix GH-862][Feature #11025]
* test/rake/*: ditto. * tool/rbinstall.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake/test_rake_top_level_functions.rb')
-rw-r--r--test/rake/test_rake_top_level_functions.rb71
1 files changed, 0 insertions, 71 deletions
diff --git a/test/rake/test_rake_top_level_functions.rb b/test/rake/test_rake_top_level_functions.rb
deleted file mode 100644
index fee702dc13a..00000000000
--- a/test/rake/test_rake_top_level_functions.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-require File.expand_path('../helper', __FILE__)
-
-class TestRakeTopLevelFunctions < Rake::TestCase
-
- def setup
- super
-
- @app = Object.new
-
- def @app.called
- @called
- end
-
- def @app.method_missing(*a, &b)
- @called ||= []
- @called << [a, b]
- nil
- end
-
- Rake.application = @app
- end
-
- def test_namespace
- block = proc do end
-
- namespace("xyz", &block)
-
- expected = [
- [[:in_namespace, 'xyz'], block]
- ]
-
- assert_equal expected, @app.called
- end
-
- def test_import
- import('x', 'y', 'z')
-
- expected = [
- [[:add_import, 'x'], nil],
- [[:add_import, 'y'], nil],
- [[:add_import, 'z'], nil],
- ]
-
- assert_equal expected, @app.called
- end
-
- def test_when_writing
- out, = capture_io do
- when_writing("NOTWRITING") do
- puts "WRITING"
- end
- end
- assert_equal "WRITING\n", out
- end
-
- def test_when_not_writing
- Rake::FileUtilsExt.nowrite_flag = true
- _, err = capture_io do
- when_writing("NOTWRITING") do
- puts "WRITING"
- end
- end
- assert_equal "DRYRUN: NOTWRITING\n", err
- ensure
- Rake::FileUtilsExt.nowrite_flag = false
- end
-
- def test_missing_other_constant
- assert_raises(NameError) do Object.const_missing(:Xyz) end
- end
-end