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

Fix warnings in spec output #464

Merged
merged 2 commits into from Aug 8, 2019

Conversation

floehopper
Copy link
Contributor

This fixes two types of warnings which were appearing in the spec output thus reducing the signal-to-noise ratio.

It's only possible to constrain the order in which calls are made when
using `expect`; not when using `allow`. Indeed you need at least two
calls to `expect` with the `ordered` qualifier to make this work.

The following warning was appearing in the spec output multiple times:

    WARNING: `allow(...).to receive(..).ordered` is not supported and will have no effect, use `and_return(*ordered_values)` instead..

Thus the calls to `ordered` were not having any effect and so I have
removed them.

See the documentation [1] for more info.

[1]: https://relishapp.com/rspec/rspec-mocks/v/3-8/docs/setting-constraints/message-order
I was seeing multiple warnings like the following in the spec output:

    W, [2019-08-07T11:42:43.494699 #48484]  WARN -- : Adapter already configured!

This was because in the Adapter::Darwin spec in the "running threads"
describe block, both `subject.configure` and `subject.start` were being
called and the latter calls the former.

By moving the call to `subject.configure` into the "configuration"
describe block, we can avoid this problem.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 97.181% when pulling 086b785 on floehopper:fix-warnings-in-spec-output into dc1e798 on guard:master.

@rymai
Copy link
Member

rymai commented Aug 8, 2019

@floehopper Thank you, looks good to me! ❤️ 💛 💚 🚀

@rymai rymai self-assigned this Aug 8, 2019
@rymai rymai merged commit 83bdac8 into guard:master Aug 8, 2019
@floehopper floehopper deleted the fix-warnings-in-spec-output branch August 8, 2019 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants