Skip to content

Commit

Permalink
Allow args in SpecRunner task
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed May 21, 2020
1 parent 3651d6b commit b883f1a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tasks/spec_runner.rake
Expand Up @@ -11,7 +11,10 @@ module RuboCop
# The specs will be run in parallel if the system implements `fork`.
# If ENV['COVERAGE'] is truthy, code coverage will be measured.
class SpecRunner
def initialize(external_encoding: 'UTF-8', internal_encoding: nil)
attr_reader :rspec_args

def initialize(rspec_args = %w[spec], external_encoding: 'UTF-8', internal_encoding: nil)
@rspec_args = rspec_args
@previous_external_encoding = Encoding.default_external
@previous_internal_encoding = Encoding.default_internal

Expand All @@ -20,8 +23,6 @@ module RuboCop
end

def run_specs
rspec_args = %w[spec]

n_failures = with_encoding do
if Process.respond_to?(:fork)
parallel_runner_klass.new(rspec_args).execute
Expand Down

0 comments on commit b883f1a

Please sign in to comment.