lib/rspec/memory/matchers/limit_allocations.rb in rspec-memory-1.0.1 vs lib/rspec/memory/matchers/limit_allocations.rb in rspec-memory-1.0.2
- old
+ new
@@ -103,11 +103,17 @@
def failure_message
"exceeded allocation limit: #{@errors.join(', ')}"
end
end
- def limit_allocations(*args)
- LimitAllocations.new(*args)
+ if respond_to?(:ruby2_keywords, true)
+ def limit_allocations(count: nil, size: nil, **allocations)
+ LimitAllocations.new(allocations, count: count, size: size)
+ end
+ else
+ def limit_allocations(*arguments)
+ LimitAllocations.new(*arguments)
+ end
end
end
end
end