Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/rake/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -754,12 +754,10 @@ def system_dir # :nodoc:
end

# The standard directory containing system wide rake files.
if Win32.windows?
def standard_system_dir #:nodoc:
def standard_system_dir #:nodoc:
if windows?
File.join(Dir.home, "Rake")
end
else
def standard_system_dir #:nodoc:
else
File.join(Dir.home, ".rake")
end
end
Expand Down
38 changes: 38 additions & 0 deletions test/test_rake_application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,44 @@ def @app.standard_system_dir
flunk "failed to find system rakefile"
end

def test_load_from_calculated_system_rakefile_on_windows
rakefile_default
def @app.windows?
true
end

@app.instance_eval do
handle_options []
options.silent = true
options.load_system = true
options.rakelib = []
load_rakefile
end

assert_equal File.join(Dir.home, "Rake"), @app.system_dir
rescue SystemExit
flunk "failed to find system rakefile"
end

def test_load_from_calculated_system_rakefile_on_unix
rakefile_default
def @app.windows?
false
end

@app.instance_eval do
handle_options []
options.silent = true
options.load_system = true
options.rakelib = []
load_rakefile
end

assert_equal File.join(Dir.home, ".rake"), @app.system_dir
rescue SystemExit
flunk "failed to find system rakefile"
end

def test_terminal_columns
old_rake_columns = ENV["RAKE_COLUMNS"]

Expand Down