标签: ruby exception-handling
foo, bar = 1, 0/0 rescue 0, 0 # this won't work foo.should eql 0 bar.should eql 0
我该怎样做这个通行证?
答案 0 :(得分:5)
foo, bar = ([1, 0/0] rescue [0, 0])