Project

General

Profile

test_case.rb

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

 
1
#! /usr/bin/env ruby
2

    
3
def bad(param_1:, param_2:, **unused)
4
  [param_1, param_2, unused]
5
end
6

    
7
data = {
8
  param_1: "whatever",
9
  param_2: "Not nil",
10
  "unused_param".to_sym => "Unused variable"
11
}
12

    
13
output = bad(data)
14

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

    
21
if false
22
  # Comment out the below line to trigger the raise on line 16.
23
  # Leave it uncommented to trigger the "success" message
24
  :unused_param
25
end