Skip to content

Commit 2cca814

Browse files
committed
A Hash argument is treated as kwargs in Ruby 2
1 parent 86d090c commit 2cca814

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/test_helper.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ module EnumSyntaxConverter
1616
def enum(name = nil, values = nil, **options, &block)
1717
return super options, &block if name == nil
1818

19+
new_options = {}
1920
if (prefix = options.delete :prefix)
20-
options[:_prefix] = prefix
21+
new_options[:_prefix] = prefix
2122
end
2223
if (suffix = options.delete :suffix)
23-
options[:_suffix] = suffix
24+
new_options[:_suffix] = suffix
2425
end
25-
super options.merge(name => values), &block
26+
super new_options.merge(name => (values || options)), &block
2627
end
2728
end
2829

0 commit comments

Comments
 (0)