Skip to content

undefined method 'expected' for an instance of RSpec::Matchers::BuiltIn::RaiseError when chaining and to raise_error #286

@richard-kramer

Description

@richard-kramer

Given this RSpec example:

require 'super_diff/rspec'

RSpec.describe do
  it 'raises' do
    expect { raise 'foo' }.to raise_error(RuntimeError, 'bar').and(change(Random, :rand))
  end
end

I would expect it to fail with message Expected raised exception #<RuntimeError "foo"> to match a kind of RuntimeError with message "bar".

Instead, I get undefined method 'expected' for an instance of RSpec::Matchers::BuiltIn::RaiseError.

It works as expected when omitting the and-Expression, and also when removing super_diff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions