I am testing a method with multiple arguments. For some reason, Ruby will run fine if I have just one argument to the calculate()
method, but when I add a second, it causes an unexpected end of input error.
This is the code:
def set_weights
actual_weight = @desired_weight.to_i - 45
calculate (actual_weight, 65)
end
def calculate (remaining_weight, plate_weight)
end
The error message is:
weights.rb:31: syntax error, unexpected ',', expecting ')'
calculate (actual_weight, 45)
^
If I remove the second argument, I get no errors.
def set_weights
actual_weight = @desired_weight.to_i - 45
calculate (actual_weight)
end
def calculate (remaining_weight)
end