rspec / rspec-mocks

RSpec's 'test double' framework, with support for stubbing and mocking
https://rspec.info
MIT License
1.16k stars 357 forks source link

Use a more common matcher name method to support other matchers #1503

Closed pirj closed 1 year ago

pirj commented 1 year ago

Previously,

    allow(true).not_to be_nil

failed with:

#<NoMethodError: undefined method `name' for #<RSpec::Matchers::BuiltIn::BeNil:0x00007f844b43a798>> with backtrace:

matcher_name is what we use in rspec-expectations https://github.com/rspec/rspec-expectations/blob/43bf64b01f8356979ffbc373b2e81d2ab1389b29/lib/rspec/matchers/built_in/base_matcher.rb#L107