spinach.rake 834 字节
Newer Older
1
Rake::Task["spinach"].clear if Rake::Task.task_defined?('spinach')
2

3 4 5 6 7
namespace :spinach do
  desc "GitLab | Spinach | Run project spinach features"
  task :project do
    cmds = [
      %W(rake gitlab:setup),
M
Mike Chmielewski 已提交
8
      %W(spinach --tags ~@admin,~@dashboard,~@profile,~@public,~@snippets,~@commits),
9 10 11
    ]
    run_commands(cmds)
  end
12

13 14 15 16
  desc "GitLab | Spinach | Run other spinach features"
  task :other do
    cmds = [
      %W(rake gitlab:setup),
M
Mike Chmielewski 已提交
17
      %W(spinach --tags @admin,@dashboard,@profile,@public,@snippets,@commits),
18 19 20
    ]
    run_commands(cmds)
  end
21 22
end

23 24
desc "GitLab | Run spinach"
task :spinach do
25 26
  cmds = [
    %W(rake gitlab:setup),
27
    %W(spinach),
28 29 30
  ]
  run_commands(cmds)
end
31

32
def run_commands(cmds)
33
  cmds.each do |cmd|
D
Dmitriy Zaporozhets 已提交
34
    system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) or raise("#{cmd} failed!")
35
  end
M
Mike Chmielewski 已提交
36
end