Project

General

Profile

Revision dce03a1e

Added by Ondřej Pražák about 7 years ago

cleaning up tests

View differences:

lib/foreman_pipeline/tasks/foreman_pipeline_test.rake
1 1
require File.expand_path("../engine", File.dirname(__FILE__))
2 2

  
3 3
namespace :test do
4
  
5
  namespace :foreman_pipeline do
6
    
7
    task :test => ['db:test:prepare'] do
8
      test_task = Rake::TestTask.new('foreman_pipeline_test_task') do |t|
9
        t.libs << ["test", "#{ForemanPipeline::Engine.root}/test"]
10
        t.test_files = ["#{ForemanPipeline::Engine.root}/test/**/*_test.rb"]
11
        t.verbose = true
12
      end
13
      Rake::Task[test_task.name].invoke
14
    end
15 4

  
16
    task :spec => ['db:test:prepare'] do
17
      test_task = Rake::TestTask.new('foreman_pipeline_spec_task') do |t|
18
        t.libs << ["spec", "#{ForemanPipeline::Engine.root}/spec", "test", "#{ForemanPipeline::Engine.root}/test"]
19
        t.test_files = ["#{ForemanPipeline::Engine.root}/spec/**/*_spec.rb"]
20
        t.verbose = true
21
      end
22
      Rake::Task[test_task.name].invoke
5
  task :foreman_pipeline => ['db:test:prepare'] do
6
    test_task = Rake::TestTask.new('foreman_pipeline_test_task') do |t|
7
      t.libs << ["test", "#{ForemanPipeline::Engine.root}/test"]
8
      t.test_files = ["#{ForemanPipeline::Engine.root}/test/**/*_test.rb"]
9
      t.verbose = true
23 10
    end
11
    Rake::Task[test_task.name].invoke
24 12
  end
13
end
25 14

  
15
Rake::Task[:test].enhance do
16
  Rake::Task['test:foreman_pipeline'].invoke
17
end
26 18

  
27
  desc "run all plugin's tests"
28
  task :foreman_pipeline do
29
    Rake::Task['test:foreman_pipeline:test'].invoke
30
    Rake::Task['test:foreman_pipeline:spec'].invoke
19
load 'tasks/jenkins.rake'
20
if Rake::Task.task_defined?(:'jenkins:unit')
21
  Rake::Task["jenkins:unit"].enhance do
22
    Rake::Task['test:foreman_pipeline'].invoke
31 23
  end
32

  
33
end
34
  
24
end

Also available in: Unified diff