Skip to content

Commit

Permalink
Merge pull request #229 from eduardoj/refactoring/rake_spec_parameters
Browse files Browse the repository at this point in the history
Set file pattern only if it is passed from the from command line
  • Loading branch information
hennevogel committed May 31, 2024
2 parents 281ee2b + 47abe41 commit cdc4b26
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 cdc4b26

Please sign in to comment.