Skip to content

Commit

Permalink
Set file pattern only if it is passed from the ...
Browse files Browse the repository at this point in the history
... from command line
  • Loading branch information
eduardoj committed May 28, 2024
1 parent 281ee2b commit 47abe41
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ require "rubocop/rake_task"
RuboCop::RakeTask.new

targeted_files = ARGV.drop(1)
file_pattern = targeted_files.empty? ? "spec/**/*_spec.rb" : targeted_files

require "rspec/core"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = FileList[file_pattern]
t.pattern = targeted_files unless targeted_files.empty?
end

RSpec.configure do |config|
Expand Down

0 comments on commit 47abe41

Please sign in to comment.