Permalink
Browse files

Improved tests for environment

  • Loading branch information...
jimweirich committed Mar 5, 2011
1 parent 1e79ad5 commit 3b5f4b096227887e53e9e9fe6ebc4b77daa051cf
Showing with 17 additions and 5 deletions.
  1. +17 −5 test/lib/environment_test.rb
@@ -4,15 +4,27 @@
require 'rake/environment'
class TestEnvironment < Test::Unit::TestCase
def test_load_string
def test_load_rakefile
Rake::Task.clear
Rake::Environment.load_string("task :xyz")
assert Rake::Task[:xyz], "should have a task named xyz"
Rake::Environment.load_rakefile("test/data/default/Rakefile")
assert Rake::Task[:default], "Should have a default task"
end
def test_load_rakefile
def test_run
Rake::Task.clear
Rake::Environment.load_rakefile("test/data/default/Rakefile")
Rake::Environment.run do
desc "demo comment"
task :default
end
assert Rake::Task[:default], "Should have a default task"
end
def test_environment
Rake::Task.clear
Rake::DSL.environment do
desc "demo comment"
task :default
end
assert Rake::Task[:default], "Should have a default task"
end
end

0 comments on commit 3b5f4b0

Please sign in to comment.