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

Add support ActiveSupport::Testing::TimeHelpers #102

Merged

Conversation

billthompson
Copy link
Contributor

ActiveSupport::Testing::TimeHelpers stubs Time.now automatically, so Timecop
won't be a required dependency when testing Stoplight inside of a gem
consumer's project.


Thanks for making this gem! If you have any specific contributor guidelines that I haven't followed, just let me know.

ActiveSupport::Testing::TimeHelpers stubs `Time.now` automatically, so Timecop
won't be a required dependency when testing Stoplight inside of a gem
consumer's project.
@tfausak tfausak self-assigned this Apr 28, 2016
@tfausak
Copy link
Collaborator

tfausak commented Apr 28, 2016

Thanks for opening this pull request! I'm all about keeping dependencies in check. However Stoplight doesn't depend on Active Support — not even for development. Timecop itself has no dependencies, so I'd prefer to keep using it instead of Active Support.

@billthompson
Copy link
Contributor Author

Thanks for the quick response!

I'm sorry I wasn't more clear in my description. This PR doesn't change Stoplight's dependencies or existing development flow. Notice that the specs weren't updated and all tests continue to pass.

That's because Time.now is the same as Time.new when called with no arguments. By accepting this change, consumers who use ActiveSupport::Test::TimeHelpers instead of Timecop can successfully time travel when testing.

I hope this is more clear, but please let me know if you have any questions.

@tfausak
Copy link
Collaborator

tfausak commented Apr 28, 2016

Oh, I see. This is for other test suites that happen to use Stoplight in them. Makes total sense.

Thanks for the patch, and I'll be sure to use Time.now in the future!

@tfausak tfausak merged commit 32fe3ff into bolshakov:master Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants