Sha256: 2bac401696a4a6c4f8a83126eaf9aa3e3c04b181fb11f666024baa95a08605c6

Contents?: true

Size: 1.14 KB

Versions: 6

Compression:

Stored size: 1.14 KB

Contents

require 'rspec/core/rake_task'

namespace :test do

  namespace :spec do

    desc "Run spec tests"
    RSpec::Core::RakeTask.new(:run) do |t|
      t.rspec_opts = ['--color']
      t.pattern = 'spec/'
    end

    desc "Run spec tests with coverage"
    RSpec::Core::RakeTask.new(:coverage) do |t|
      ENV['BEAKER_TEMPLATE_COVERAGE'] = 'y'
      t.rspec_opts = ['--color']
      t.pattern = 'spec/'
    end

  end

  namespace :acceptance do

    desc <<-EOS
A quick acceptance test, named because it has no pre-suites to run
    EOS
    task :quick do

      sh("beaker",
         "--hosts", ENV['CONFIG'] || "acceptance/config/nodes/vagrant-ubuntu-1404.yml",
         "--tests", "acceptance/tests",
         "--log-level", "debug",
         "--keyfile", ENV['KEY'] || "#{ENV['HOME']}/.ssh/id_rsa")
    end

  end

end

# namespace-named default tasks.
# these are the default tasks invoked when only the namespace is referenced.
# they're needed because `task :default` in those blocks doesn't work as expected.
task 'test:spec' => 'test:spec:run'
task 'test:acceptance' => 'test:acceptance:quick'

# global defaults
task :test => 'test:spec'
task :default => :test

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
beaker-hostgenerator-0.3.3 Rakefile
beaker-hostgenerator-0.3.2 Rakefile
beaker-hostgenerator-0.3.1 Rakefile
beaker-hostgenerator-0.3.0 Rakefile
beaker-hostgenerator-0.2.0 Rakefile
beaker-hostgenerator-0.1.0 Rakefile