Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (31 sloc) 1.025 kb
require File.expand_path('../helper', __FILE__)
class TestRakeRequire < Rake::TestCase
def test_can_load_rake_library
app = Rake::Application.new
app.options.threads = Rake.application.options.threads
assert app.instance_eval {
rake_require("test2", ['test/data/rakelib'], [])
}
end
def test_wont_reload_rake_library
app = Rake::Application.new
app.options.threads = Rake.application.options.threads
paths = ['test/data/rakelib']
loaded_files = []
app.rake_require("test2", paths, loaded_files)
assert ! app.instance_eval {
rake_require("test2", paths, loaded_files)
}
end
def test_throws_error_if_library_not_found
app = Rake::Application.new
app.options.threads = Rake.application.options.threads
ex = assert_raises(LoadError) {
assert app.instance_eval {
rake_require("testx", ['test/data/rakelib'], [])
}
}
assert_match(/(can *not|can't)\s+find/i, ex.message)
assert_match(/testx/, ex.message)
end
end
Jump to Line
Something went wrong with that request. Please try again.