Skip to content

Commit

Permalink
Refactor format batch of Ruby and Rake
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexB52 committed Nov 24, 2024
1 parent b315504 commit 560f555
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/retest/command/rake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def to_s
end

def format_batch(*files)
files.size > 1 ? "\"{#{files.join(',')}}\"" : files.first
files.size > 1 ? %Q{"{#{files.join(',')}}"} : files.first
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/retest/command/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def to_s
end

def format_batch(*files)
%Q{-e "#{files.map { |file| "require './#{file}';" }.join}"}
files.size > 1 ? %Q{-e "#{files.map { |file| "require './#{file}';" }.join}"} : files.first
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/retest/command/ruby_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_to_s
end

def test_format_with_one_file
assert_equal %Q{-e "require './a/file/path.rb';"}, @subject.format_batch('a/file/path.rb')
assert_equal 'a/file/path.rb', @subject.format_batch('a/file/path.rb')
end

def test_format_with_multiple_files
Expand Down

0 comments on commit 560f555

Please sign in to comment.