Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with raise_error from RSpec #136

Closed
joergschiller opened this issue Dec 20, 2024 · 1 comment · Fixed by #137
Closed

Conflict with raise_error from RSpec #136

joergschiller opened this issue Dec 20, 2024 · 1 comment · Fixed by #137

Comments

@joergschiller
Copy link

joergschiller commented Dec 20, 2024

We have a system spec that looks like this:

it "raises a not found error" do
  expect { visit reportings_account_dashboard_path(project) }.to raise_error(ActiveRecord::RecordNotFound)
end

After upgrading capybara-screenshot-diff this fails with:

ArgumentError:
 wrong number of arguments (given 1, expected 2)
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/capybara-screenshot-diff-1.9.2/lib/capybara/screenshot/diff/test_methods.rb:171:in `raise_error'
# ./spec/features/admin/mailers_spec.rb:63:in `block (3 levels) in <top (required)>'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:263:in `instance_exec'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:263:in `block in run'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:511:in `block in with_around_and_singleton_context_hooks'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:468:in `block in with_around_example_hooks'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/hooks.rb:486:in `block in run'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/hooks.rb:626:in `block in run_around_example_hooks_for'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:352:in `call'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-rails-7.1.0/lib/rspec/rails/example/system_example_group.rb:174:in `block (2 levels) in <module:SystemExampleGroup>'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:457:in `instance_exec'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:457:in `instance_exec'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/hooks.rb:390:in `execute_with'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:352:in `call'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-rails-7.1.0/lib/rspec/rails/adapters.rb:75:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:457:in `instance_exec'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:457:in `instance_exec'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/hooks.rb:390:in `execute_with'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
# /Users/joerg/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/example.rb:352:in `call'
# ./spec/rails_helper.rb:219:in `block (2 levels) in <top (required)>'

It looks like your Capybara::Screenshot::Diff::TestMethods#raise_error conflicts with RSpec::Matchers#raise_error.

Let me know if I can provide you with more details.

Thanks for your help!

@pftg
Copy link
Collaborator

pftg commented Dec 20, 2024

Thanks @joergschiller I'm going to fix

pftg added a commit that referenced this issue Dec 20, 2024
pftg added a commit that referenced this issue Dec 20, 2024
pftg added a commit that referenced this issue Dec 20, 2024
@pftg pftg closed this as completed in #137 Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants