ruby - Reference a variable in a test script -
ruby - Reference a variable in a test script -
i have created deck class , have defined 1 of functions insert card @ origin of array. everytime seek test in test script receive `add_to_bottom': wrong number of arguments (1 0) (argumenterror). can please help me know close figuring out.
deck class
def add_to_bottom @cards.insert(0, c) end
test script
d = deck.new c = card.new(7, "s") d.add_to_bottom(c) print d, "\n"
add_to_bottom
has c
in method body, neither method nor variable. if meant argument passed, need write def add_to_bottom(c)
. if that, resolve error.
ruby
Comments
Post a Comment