Skip to content

Better documentation for TravelAround cop #68

@JacobEvelyn

Description

@JacobEvelyn

I've looked at both the documentation and the initial commit for the TravelAround cop and I don't understand why it's making the recommendation it is.

The first thing I found confusing is that it's not obvious that before { freeze_time } resets the stubbing at the end of that test, though it is mentioned in the Rails documentation for travel_to (but not freeze_time). Clarification there would help me (and others) feel more confident making the change.

My second piece of confusion is this note in the docs:

This cop is unsafe because the automatic travel_back is only run on test cases that are considered as Rails related.

Could that link to Rails documentation or add more detail? Am I reading that right that the after_teardown hook isn't always called? How can I as a developer know whether my test is "considered as Rails related"?

My last bit of confusion is why before is preferable to around. Could that be explained in the docs? Especially given the warnings in the docs related to safety, I see downsides to before but am not clear on what the upsides are.

Thanks so much! ❤

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions