Skip to content
Merged
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
2 changes: 1 addition & 1 deletion lib/rake/task_arguments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def method_missing(sym, *args)

# Returns a Hash of arguments and their values
def to_hash
@hash
@hash.dup
end

def to_s # :nodoc:
Expand Down
2 changes: 2 additions & 0 deletions test/test_rake_application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent
end

def test_load_rakefile_not_found
skip if jruby9?

ARGV.clear
Dir.chdir @tempdir
ENV["RAKE_SYSTEM"] = "not_exist"
Expand Down
2 changes: 2 additions & 0 deletions test/test_rake_functional.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def test_by_default_rakelib_files_are_included
end

def test_implicit_system
skip if jruby9?

rake_system_dir
Dir.chdir @tempdir

Expand Down
8 changes: 8 additions & 0 deletions test/test_rake_task_arguments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ def test_to_s
assert_equal ta.to_hash.inspect, ta.inspect
end

def test_to_hash
ta = Rake::TaskArguments.new([:one], [1])
h = ta.to_hash
h[:one] = 0
assert_equal 1, ta.fetch(:one)
assert_equal 0, h.fetch(:one)
end

def test_enumerable_behavior
ta = Rake::TaskArguments.new([:a, :b, :c], [1, 2, 3])
assert_equal [10, 20, 30], ta.map { |k, v| v * 10 }.sort
Expand Down