2014-04-11 11:31:37 +00:00
|
|
|
namespace :testing do
|
|
|
|
desc 'GITLAB | Run model specs'
|
|
|
|
task :models do
|
|
|
|
cmds = [
|
|
|
|
%W(rake gitlab:setup),
|
|
|
|
%W(rspec spec --tag @models)
|
|
|
|
]
|
|
|
|
run_commands(cmds)
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'GITLAB | Run feature specs'
|
|
|
|
task :features do
|
|
|
|
cmds = [
|
|
|
|
%W(rake gitlab:setup),
|
|
|
|
%W(rspec spec --tag @features)
|
|
|
|
]
|
|
|
|
run_commands(cmds)
|
|
|
|
end
|
2014-03-14 08:44:16 +00:00
|
|
|
|
2014-04-11 11:31:37 +00:00
|
|
|
desc 'GITLAB | Run other specs'
|
|
|
|
task :other do
|
|
|
|
cmds = [
|
|
|
|
%W(rake gitlab:setup),
|
|
|
|
%W(rspec spec --tag ~@models --tag ~@features)
|
|
|
|
]
|
|
|
|
run_commands(cmds)
|
|
|
|
end
|
2014-03-14 08:44:16 +00:00
|
|
|
|
2014-04-11 11:31:37 +00:00
|
|
|
def run_commands(cmds)
|
|
|
|
cmds.each do |cmd|
|
|
|
|
system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd)
|
|
|
|
raise "#{cmd} failed!" unless $?.exitstatus.zero?
|
|
|
|
end
|
2014-03-14 08:44:16 +00:00
|
|
|
end
|
|
|
|
end
|