3
我有一些lambda代碼,例如rspec - 如何更改lambda應該期望的?
lambda { Watir::Browser.new(mock_driver) }.should_not raise_error
我該如何改變它以使用expect語法?
我想:
expect({ Watir::Browser.new(mock_driver)}).to not raise_error
但我得到:
syntax error, unexpected '}', expecting tASSOC (SyntaxError)
...expect ({Watir::Browser.new(mock_driver)}).to not raise_error
,我試圖
expect{(Watir::Browser.new(mock_driver))}.to not raise_error
,但得到
syntax error, unexpected tIDENTIFIER, expecting '('