Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

expect_no_warnings errors #777

@chrisarcand

Description

@chrisarcand

I was looking into #762 and didn't recognize expect_no_warnings in the tests for raise_error. I searched and searched all the repos without success until I realized it's likely a mistake - the test suite does not currently pass.

Failures:

  1) expect { ... }.to raise_error can supresses the warning when configured to do so
     Failure/Error: expect_no_warnings
     NameError:
       undefined local variable or method `expect_no_warnings' for #<RSpec::ExampleGroups::ExpectToRaiseError:0x007ff7795316c8>
     # ./spec/rspec/matchers/built_in/raise_error_spec.rb:18:in `block (2 levels) in <top (required)>'

  2) expect { ... }.to raise_error does not issue a warning when a block is passed
     Failure/Error: expect_no_warnings
     NameError:
       undefined local variable or method `expect_no_warnings' for #<RSpec::ExampleGroups::ExpectToRaiseError:0x007ff77953b8f8>
     # ./spec/rspec/matchers/built_in/raise_error_spec.rb:33:in `block (2 levels) in <top (required)>'

  3) expect { ... }.to raise_error does not issue a warning when an exception class is specified (even if it is just `Exception`)
     Failure/Error: expect_no_warnings
     NameError:
       undefined local variable or method `expect_no_warnings' for #<RSpec::ExampleGroups::ExpectToRaiseError:0x007ff77953a638>
     # ./spec/rspec/matchers/built_in/raise_error_spec.rb:23:in `block (2 levels) in <top (required)>'

  4) expect { ... }.to raise_error does not issue a warning when a message is specified
     Failure/Error: expect_no_warnings
     NameError:
       undefined local variable or method `expect_no_warnings' for #<RSpec::ExampleGroups::ExpectToRaiseError:0x007ff779538090>
     # ./spec/rspec/matchers/built_in/raise_error_spec.rb:28:in `block (2 levels) in <top (required)>'

Finished in 2.04 seconds (files took 0.41244 seconds to load)
1972 examples, 4 failures

This was introduced recently in https://github.com/rspec/rspec-expectations/pull/768/files

Sorry in advance if this is already known and intended.

cc/ @JonRowe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions