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

Test runner misreports model class as test file for rerun #23686

Closed
dhh opened this issue Feb 15, 2016 · 2 comments
Closed

Test runner misreports model class as test file for rerun #23686

dhh opened this issue Feb 15, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@dhh
Copy link
Member

dhh commented Feb 15, 2016

Stumbled across this today:

F

Failure:
DeliveryTest#test_delivery_of_new_comment_doesnt_happen_when_notification_granularity_is_only_pings_and_mentions:
unexpected invocation: #<AnyInstance:ActionNotifier::Deliveries::WebDelivery>.deliver_to(#<User:0x7fa64615b668>)
unsatisfied expectations:
- expected never, invoked once: #<AnyInstance:ActionNotifier::Deliveries::WebDelivery>.deliver_to(any_parameters)

bin/rails test app/models/deliveries/delivery.rb:103

The test file is test/models/delivery_test.rb, but it's reporting the model file instead.

The test itself uses Mocha. If I flunk earlier in the test before that's triggered, then the reporting is correct.

@dhh dhh added the railties label Feb 15, 2016
@dhh dhh added this to the 5.0.0 milestone Feb 15, 2016
@senny
Copy link
Member

senny commented Feb 15, 2016

After fixing this, the following output:

Failure:
ArticleTest#test_mocha:
unexpected invocation: #<AnyInstance:User(id: integer, name: string, created_at: datetime, updated_at: datetime)>.blub()
unsatisfied expectations:
- expected never, invoked once: #<AnyInstance:User(id: integer, name: string, created_at: datetime, updated_at: datetime)>.blub(any_parameters)



bin/rails test app/models/user.rb:15

will look like this:

Failure:
ArticleTest#test_mocha [/Users/senny/Projects/ruby/rails/dev/app/models/user.rb:15]:
unexpected invocation: #<AnyInstance:User(id: integer, name: string, created_at: datetime, updated_at: datetime)>.blub()
unsatisfied expectations:
- expected never, invoked once: #<AnyInstance:User(id: integer, name: string, created_at: datetime, updated_at: datetime)>.blub(any_parameters)



bin/rails test test/models/user_test.rb:23

@senny senny closed this as completed in ea70c29 Feb 15, 2016
@kaspth
Copy link
Contributor

kaspth commented Feb 15, 2016

❤️💚💙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants