Skip to content

Instantly share code, notes, and snippets.

@amireh
Created December 19, 2013 12:25
Show Gist options
  • Save amireh/8038380 to your computer and use it in GitHub Desktop.
Save amireh/8038380 to your computer and use it in GitHub Desktop.
Really weird interpreter issue going on with ruby 1.9.3 and rspec 1.3.2. In the first spec, the call to `expect({}).to()` is not receiving the `raise_error()` as an argument since it's on a second line, and I don't know what it's taking for an argument. If we move the `to` directive down to the `raise_error` line as in spec#2, it works!
describe 'Smelly RSpec 1.3.2' do
it "should fail, but doesn't" do
# this will pass, even though it should fail
expect { raise ArgumentError, 'bar' }.to
raise_error(ArgumentError, /foo/i)
end
it "should fail, and it does" do
# and this would work -.-'
expect { raise ArgumentError, 'bar' }.
to raise_error(ArgumentError, /foo/i)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment