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

Modernize rspec usage and fix warnings #99

Merged
merged 10 commits into from Sep 23, 2016

Conversation

Projects
None yet
2 participants
@ivoanjo
Copy link
Contributor

ivoanjo commented Sep 22, 2016

This PR upgrades rspec to the latest 3.5 version, and then enables a number of rspec recommended optional features.

It then removes the need for a spec_helper, updates the specs not to use monkey patched versions of rspec methods, and fixes a number of ruby warnings.

Finally, it speeds up test suite execution by 15 seconds by lowering the network_recovery_interval in the connection spec.

Hope these are acceptable, and thanks for your work on the gem!

ivoanjo added some commits Sep 22, 2016

Automatically require spec_helper in .rspec file
This avoids the need to remember to manually require the spec_helper on
each spec, and the perils of forgetting to require it.
Add modern rspec configuration generated with rspec --init
Modern rspec versions include a lot of options that are recommended but
not on by default so as to not break backwards-compatibility with users
upgrading from earlier 3.x versions.

When generating a new spec_helper with rspec --init, rspec sets a number
of these recommended defaults, of which I enabled all but the warnings
and the disable_monkey_patching!
Add spec/examples.txt to gitignore
This file is automatically generated by rspec to persist state between
runs and should not be versioned.
Use RSpec.describe and disable rspec monkey patching
By using the RSpec.describe syntax instead of just describe, rspec's
monkey patches can be disabled, thus avoiding their possible pitfalls
(see rspec's documentation for more details).
Speed up connection spec by reducing network_recovery_interval
The connection spec tests automatic recovery under several different
connection cases, but three of the tests were wasting 15 seconds of
spec suite execution because automatic recovery sleeps by default by 5
seconds before recreating a new connection.

As this behavior can be tested separately, I've lowered the
network_recovery_interval to 0 so as to speedup the test suite and still
correctly exercise the code.

@michaelklishin michaelklishin self-assigned this Sep 23, 2016

@michaelklishin

This comment has been minimized.

Copy link
Member

michaelklishin commented Sep 23, 2016

Thank you.

@michaelklishin michaelklishin merged commit 281d828 into ruby-amqp:master Sep 23, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment