I have some lambda code, e.g.
lambda { Watir::Browser.new(mock_driver) }.should_not raise_error
How can I change this to use the expect syntax?
I tried:
expect({ Watir::Browser.new(mock_driver)}).to not raise_error
but I got:
syntax error, unexpected '}', expecting tASSOC (SyntaxError)
...expect ({Watir::Browser.new(mock_driver)}).to not raise_error
and I tried
expect{( Watir::Browser.new(mock_driver))}.to not raise_error
but got
syntax error, unexpected tIDENTIFIER, expecting '('
You don't need those parentheses.
expect{Watir::Browser.new(mock_driver)}.to_not raise_error
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With