Project

General

Profile

Bug #11091 » test_case.rb

danfinnie (Daniel Finnie), 05/04/2015 04:18 PM

 
#! /usr/bin/env ruby

def bad(param_1:, param_2:, **unused)
[param_1, param_2, unused]
end

data = {
param_1: "whatever",
param_2: "Not nil",
"unused_param".to_sym => "Unused variable"
}

output = bad(data)

if output[1] != "Not nil"
raise "Output 1 has unexpected value: #{output[1].inspect}"
else
puts "Success"
end

if false
# Comment out the below line to trigger the raise on line 16.
# Leave it uncommented to trigger the "success" message
:unused_param
end
(2-2/2)