require 'gem2deb/rake/testtask'

Gem2Deb::Rake::TestTask.new do |t|

  if ENV["AUTOPKGTEST_TMP"].nil?
    # run only unit tests for sanity checking
    File.rename "lib", ".gem2deb.lib"
    puts "---> Running unit tests"
    sh %{rspec spec/unit/**/*_spec.rb}
    File.rename ".gem2deb.lib", "lib"
  else
    # run full testsuite
    load "rakelib/parallel.rake"
    Rake::Task["parallel:spec"].invoke
  end

end
