Sha256: dee1d5a6b531220253af3a2d3b4f704a04e26dd59b621937ad543d869e9d2a5e

Contents?: true

Size: 1.3 KB

Versions: 68

Compression:

Stored size: 1.3 KB

Contents

require 'rspec/core/rake_task'
require 'rake/testtask'

namespace :test do

  namespace :spec do

    task :minitest do
      desc "Run minitest tests"
      Rake::TestTask.new do |task|
        task.libs << %w(test lib)
        task.test_files = FileList['test/test*.rb']
        task.verbose = true
      end
    end

    desc "Run spec tests"
    RSpec::Core::RakeTask.new(:run) do |t|
      t.rspec_opts = ['--color']
      t.pattern = 'spec/'
      t.ruby_opts = '-Itest'
    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

end

namespace :generate do
  desc "Generate test fixtures."
  task :fixtures do
    $LOAD_PATH.unshift(
      File.join(Dir.pwd, 'lib'),
      File.join(Dir.pwd, 'test')
    )
    require 'beaker-hostgenerator'
    require 'util/generator_helpers'

    fixgen = FixtureGenerator.new
    fixgen.generate
  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', 'test:spec:minitest']

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

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
beaker-hostgenerator-1.2.10 Rakefile
beaker-hostgenerator-1.2.9 Rakefile
beaker-hostgenerator-1.2.8 Rakefile
beaker-hostgenerator-1.2.7 Rakefile
beaker-hostgenerator-1.2.6 Rakefile
beaker-hostgenerator-1.2.5 Rakefile
beaker-hostgenerator-1.2.4 Rakefile
beaker-hostgenerator-1.2.3 Rakefile
beaker-hostgenerator-1.2.2 Rakefile
beaker-hostgenerator-1.2.1 Rakefile
beaker-hostgenerator-1.2.0 Rakefile
beaker-hostgenerator-1.1.44 Rakefile
beaker-hostgenerator-1.1.43 Rakefile
beaker-hostgenerator-1.1.42 Rakefile
beaker-hostgenerator-1.1.41 Rakefile
beaker-hostgenerator-1.1.40 Rakefile
beaker-hostgenerator-1.1.39 Rakefile
beaker-hostgenerator-1.1.38 Rakefile
beaker-hostgenerator-1.1.37 Rakefile
beaker-hostgenerator-1.1.36 Rakefile