4
当我尝试做为什么红宝石在这里需要括号?
assert_equal { dry: true }, res
我得到
syntax error, unexpected ':', expecting '}'
assert_equal { dry: true }, res
但
assert_equal({ dry: true }, res)
工作正常。为什么第一种形式不足以让红宝石了解我的意思是什么 ?或者更确切地说,Ruby认为我正在尝试做什么?
相关提示,谢谢:) – Paladin