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

Resolve all warnings emitted during testing #54

Merged
merged 5 commits into from
Jul 22, 2019
Merged

Resolve all warnings emitted during testing #54

merged 5 commits into from
Jul 22, 2019

Conversation

zenspider
Copy link
Contributor

This removes all warnings emitted during testing of mixlib-log or inspec.

Description

ruby -w, rspec -w, and minitest -w all run with $-w = true and output warnings on use of uninitialized variables among other things. This PR cleans those up for this project. It also changes some tests around to be more idiomatic and to avoid logging going to stdout on top of the rspec output.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • [o] I have updated the documentation accordingly.
  • [o] I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

zenspider added 2 commits June 5, 2019 18:58
Makes the code run nearly warning free, reducing the output
of `rspec -w spec` by 42 lines. That has to mean something,
right?

Signed-off-by: Ryan Davis <[email protected]>
zenspider added 3 commits June 6, 2019 13:36
This makes it testable using minitest/rspec IO
assertions/expectations. STDOUT/STDERR should only be used to restore
$stdout/$stderr if something goes haywire. The globals should be used
for everyday use.

Also bolstered an IO test to prevent the output from going to the
rspec result output.

Signed-off-by: Ryan Davis <[email protected]>
Otherwise the tests were resetting twice per.

Signed-off-by: Ryan Davis <[email protected]>
Also removed a line that didn't have the effect intended. Those were
class-ivars, not ivars.

Signed-off-by: Ryan Davis <[email protected]>
@zenspider
Copy link
Contributor Author

poke. I'd merge this but apparently I don't have perms.

@tas50 tas50 changed the title Remove warnings Resolve all warnings emitted during testing Jul 22, 2019
@tas50 tas50 merged commit 8721333 into chef:master Jul 22, 2019
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.

3 participants