Skip to content

Commit 710b4db

Browse files
committed
Add unit test for "standard" system dir
1 parent 4943ea7 commit 710b4db

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/test_rake_application.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,28 @@ def @app.standard_system_dir
365365
flunk "failed to find system rakefile"
366366
end
367367

368+
def test_load_from_standard_system_rakefile
369+
rakefile_default
370+
371+
ENV["RAKE_SYSTEM"] = nil
372+
373+
@app.instance_eval do
374+
handle_options []
375+
options.silent = true
376+
options.load_system = true
377+
options.rakelib = []
378+
load_rakefile
379+
end
380+
381+
if @app.windows?
382+
assert_equal File.join(Dir.home, "Rake"), @app.system_dir
383+
else
384+
assert_equal File.join(Dir.home, ".rake"), @app.system_dir
385+
end
386+
rescue SystemExit
387+
flunk "failed to find system rakefile"
388+
end
389+
368390
def test_terminal_columns
369391
old_rake_columns = ENV["RAKE_COLUMNS"]
370392

0 commit comments

Comments
 (0)