Question: Why does my rspec matcher not meet my equality error conditions?

Question

Why does my rspec matcher not meet my equality error conditions?

Answers 0
Added at 2017-11-07 20:11
Tags
Question

I am getting the following error in my spec, but my errors are identical:

expected: (#<MessageStrategySMS::CountryNotSupportedError: The country 'AZ' is not supported by Package Zen, please add it to Lookup.>)
   got: (#<MessageStrategySMS::CountryNotSupportedError: The country 'AZ' is not supported by Package Zen, please add it to Lookup.>)

My spec code is the following:

err = MessageStrategySMS::CountryNotSupportedError.new("The country 'AZ' is not supported by Package Zen, please add it to Lookup.")
    expect(Raven).to receive(:capture_exception).with(err)

And my actual code is the following:

error = CountryNotSupportedError.new, "The country '#{country_code}' is not supported by Package Zen, please add it to Lookup."
Raven.capture_exception(error)

Does .with() look at .id comparisons or something?

Answers to

Why does my rspec matcher not meet my equality error conditions?

Source Show
◀ Wstecz