Skip to content
Merged
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
15 changes: 15 additions & 0 deletions core/module/ruby2_keywords_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,21 @@ def proc_call(*args)
Hash.ruby2_keywords_hash?(marked).should == true
end

it "does not copy or unmark the Hash when it is passed directly as a positional argument" do
obj = Object.new
def obj.single(arg)
arg
end

h = { a: 1 }
marked = mark(**h).last
Hash.ruby2_keywords_hash?(marked).should == true

after_usage = obj.single(marked)
after_usage.should.equal?(marked)
Hash.ruby2_keywords_hash?(after_usage).should == true
end

it "applies to the underlying method and applies across aliasing" do
obj = Object.new

Expand Down
Loading