Skip to content

Commit

Permalink
Merge pull request #175 from pda/task-argument-key-predicate
Browse files Browse the repository at this point in the history
Rake::TaskArguments#key? alias of #has_key?
  • Loading branch information
hsbt committed Dec 6, 2016
2 parents b85038d + 2dca36e commit 1b62cbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rake/task_arguments.rb
Expand Up @@ -87,6 +87,7 @@ def inspect # :nodoc:
def has_key?(key)
@hash.has_key?(key)
end
alias key? has_key?

def fetch(*args, &block)
@hash.fetch(*args, &block)
Expand Down
2 changes: 2 additions & 0 deletions test/test_rake_task_arguments.rb
Expand Up @@ -27,7 +27,9 @@ def test_blank_values_in_args
def test_has_key
ta = Rake::TaskArguments.new([:a], [:one])
assert(ta.has_key?(:a))
assert(ta.key?(:a))
refute(ta.has_key?(:b))
refute(ta.key?(:b))
end

def test_fetch
Expand Down

0 comments on commit 1b62cbb

Please sign in to comment.