class Frameworks::Minitest

Public Instance Methods

command(*args) click to toggle source
# File lib/soundcheck/frameworks/minitest.rb, line 17
def command(*args)
  # If we were given args, but none of them are minitest files,
  # then we skip minitest
  return if not args.empty? and filter(*args).empty?
  args = filter(*args)

  # rake test can either run a single file, or all of them,
  # so if we're given more than one, just run all
  args = [] if args.length > 1
  args = args.map {|i| "TEST=#{i}" }

  to_run = []
  to_run << "bundle exec" if has_gemfile?
  to_run << "rake test"
  to_run << "-t" if options[:trace]
  to_run << args.join(" ")
  to_run.join(" ").strip
end
filter(*args) click to toggle source
# File lib/soundcheck/frameworks/minitest.rb, line 9
def filter(*args)
  filter_with(args, {
    :is_test_file   => /_test\.rb$/,
    :is_in_test_dir => /^test/,
    :is_dir         => lambda {|arg| project.has_dir?(arg) }
  })
end
present?() click to toggle source
# File lib/soundcheck/frameworks/minitest.rb, line 5
def present?
  project.has_file?("test")
end

Private Instance Methods

has_gemfile?() click to toggle source
# File lib/soundcheck/frameworks/minitest.rb, line 42
def has_gemfile?
  project.has_file?("Gemfile")
end
has_test_dir?() click to toggle source
# File lib/soundcheck/frameworks/minitest.rb, line 38
def has_test_dir?
  project.has_dir?("test")
end