yujinakayama/transpec

Failing conversion of error_on specs...

jasonm23 opened this issue · 3 comments

We originally had the following expectations: (subject is a model, with .date property.)

entry.date = '2013-05-31'
expect(entry).to_not be_valid
expect(entry).to have(1).error_on :date

entry.date = '2013-04-30'
entry.valid?
expect(entry).to have(0).errors_on :date

Which transpec updates to:

entry.date = '2013-05-31'
expect(entry).to_not be_valid
expect(entry.error_on :date.size).to eq(1)

entry.date = '2013-04-30'
entry.valid?
expect(entry.errors_on :date.size).to eq(0)

Which should be:

entry.date = '2013-05-31'
expect(entry).to_not be_valid
expect(entry.error_on(:date).count).to eq(1)

entry.date = '2013-04-30'
entry.valid?
expect(entry.errors_on(:date).count).to eq(0)

However, Since to_have and errors_on / error_on are provided by rspec-collection_matchers.

I thought error_on wasn't supported in rspec 3.

Didn't you use --skip-dynamic-analysis option?

No, this was a straight run, no options

Closing since the issue could not be reproduced in my environment. Please reopen if you can provide reproducible example.