I am trying to spec behaviors for command line arguments my script receives to ensure that all validation passes. Some of my command line arguments will result in abo
abo
There's no need for custom matchers or rescue blocks, simply:
expect { exit 1 }.to raise_error(SystemExit) do |error| expect(error.status).to eq(1) end
I'd argue that this is superior because it's explicit and plain Rspec.