forked from standardrb/standard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This addresses the second feature mentioned in standardrb#452. For context, when debugging a RuboCop issue a user is asked to supply the output of `rubocop -V`, and this streamlines this process for standard users.
- Loading branch information
1 parent
830205c
commit 51e755f
Showing
5 changed files
with
64 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require_relative "rubocop" | ||
|
||
module Standard | ||
module Runners | ||
class VerboseVersion | ||
def call(config) | ||
puts <<-MSG.gsub(/^ {10}/, "") | ||
Standard version: #{Standard::VERSION} | ||
RuboCop version: #{RuboCop::Version.version(debug: true)} | ||
MSG | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require_relative "../../test_helper" | ||
|
||
require "standard/runners/verbose_version" | ||
|
||
class Standard::Runners::VerboseVersionTest < UnitTest | ||
def setup | ||
@subject = Standard::Runners::VerboseVersion.new | ||
end | ||
|
||
def test_verbose_version | ||
fake_out, _ = do_with_fake_io { | ||
@subject.call(nil) | ||
} | ||
|
||
expect = <<-EXPECT.gsub(/^ {6}/, "") | ||
Standard version: #{Standard::VERSION} | ||
RuboCop version: #{RuboCop::Version.version(debug: true)} | ||
EXPECT | ||
|
||
assert_equal expect, fake_out.string | ||
end | ||
|
||
def test_includes_rubocop_sub_dependencies | ||
fake_out, _ = do_with_fake_io { | ||
@subject.call(nil) | ||
} | ||
|
||
assert_match(/Parser/, fake_out.string) | ||
assert_match(/rubocop-ast/, fake_out.string) | ||
end | ||
end |