-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
tests: add cmd/style integration test #388
Conversation
Adding RuboCop to the
I don't have a good solution to address these. But since
Can you elaborate on this? In normal operation, |
Yeh, I'm also interested in that. A step-by-step walkthrough of the commands you run and the errors you see would be great 👍 |
Good to know and to keep in mind. 👍
Sure thing! I did see I've checked out a test branch from the
I also receive this
(followed by the names of the tests that were run) |
EOS | ||
|
||
assert_match "Prefer double-quoted strings", cmd_fail("style") | ||
assert_match "1 file inspected, 1 offense detected", cmd_fail("style", "#{foo_file}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try wrapping this line and the one below with:
Bundler.with_clean_env do
...
end
and remove the Gemfile* changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why wrap only these 2 lines?
assert_match "1 file inspected, 1 offense detected", cmd_fail("style", "#{foo_file}")
assert_match "1 file inspected, 1 offense detected", cmd_fail("style", "foo")
In any case, I removed the Gemfile*
changes and tried wrapping those 2 lines (and all 3 lines). Received the same error in both cases. :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the problem and what the correct solution is, but Bundler.with_clean_env
sadly isn't going to help (or change anything) here. It is already used in the implementation of cmd[_fail]
, or to be more precise in cmd_output
where it is used to start a separate Homebrew process (but with the necessary adjustments for the testing environment) in which it then executes the specified Homebrew command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation and sorry for the late response! I guess this pull request will be relegated to the dustbin, but it was worth a try, and I now have a better understanding of cmd
and cmd_output
. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, it's probably worth closing this out for now, sorry @eirinikos 😭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry! It's always a bit sad to let go of a PR, but it would be strange if every single one of them was a success story. On the positive side, I think we all learned a few things here. :)
brew tests
with your changes locally?This change adds some test coverage for
brew style
. It looks like the parts concerning JSON output (including theRubocopResults
RubocopOffense
, andRubocopLineLocation
classes) would be served by adding test coverage forbrew audit --strict
(which I'll add to my to-do list).It seemed necessary to add
rubocop
to theGemfile
, but if that's incorrect, I look forward to finding out!I'll be sure to update the creation and unlinking of the
foo
formula once this pull request is finalized/merged.Thanks!