schacon/ruby-git

View on GitHub
bin/test

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/setup'

`git config --global user.email "git@example.com"` if `git config user.email`.empty?
`git config --global user.name "GitExample"` if `git config user.name`.empty?
`git config --global init.defaultBranch master` if `git config init.defaultBranch`.empty?

project_root = File.expand_path(File.join(__dir__, '..'))

$LOAD_PATH.unshift(File.join(project_root, 'tests'))

paths =
  if ARGV.empty?
    Dir.glob('tests/units/test_*.rb').map { |p| File.basename(p) }
  else
    ARGV
  end.map { |p| File.join(project_root, 'tests/units', p) }

paths.each { |p| require p }