Ignore teaspoon tasks in production environment
This commit is contained in:
parent
dcc699afc2
commit
8a9c7b1e04
1 changed files with 20 additions and 18 deletions
|
@ -1,23 +1,25 @@
|
|||
Rake::Task['teaspoon'].clear if Rake::Task.task_defined?('teaspoon')
|
||||
unless Rails.env.production?
|
||||
Rake::Task['teaspoon'].clear if Rake::Task.task_defined?('teaspoon')
|
||||
|
||||
namespace :teaspoon do
|
||||
desc 'GitLab | Teaspoon | Generate fixtures for JavaScript tests'
|
||||
RSpec::Core::RakeTask.new(:fixtures) do |t|
|
||||
ENV['NO_KNAPSACK'] = 'true'
|
||||
t.pattern = 'spec/javascripts/fixtures/*.rb'
|
||||
t.rspec_opts = '--format documentation'
|
||||
namespace :teaspoon do
|
||||
desc 'GitLab | Teaspoon | Generate fixtures for JavaScript tests'
|
||||
RSpec::Core::RakeTask.new(:fixtures) do |t|
|
||||
ENV['NO_KNAPSACK'] = 'true'
|
||||
t.pattern = 'spec/javascripts/fixtures/*.rb'
|
||||
t.rspec_opts = '--format documentation'
|
||||
end
|
||||
|
||||
desc 'GitLab | Teaspoon | Run JavaScript tests'
|
||||
task :tests do
|
||||
require "teaspoon/console"
|
||||
options = {}
|
||||
abort('rake teaspoon:tests failed') if Teaspoon::Console.new(options).failures?
|
||||
end
|
||||
end
|
||||
|
||||
desc 'GitLab | Teaspoon | Run JavaScript tests'
|
||||
task :tests do
|
||||
require "teaspoon/console"
|
||||
options = {}
|
||||
abort('rake teaspoon:tests failed') if Teaspoon::Console.new(options).failures?
|
||||
desc 'GitLab | Teaspoon | Shortcut for teaspoon:fixtures and teaspoon:tests'
|
||||
task :teaspoon do
|
||||
Rake::Task['teaspoon:fixtures'].invoke
|
||||
Rake::Task['teaspoon:tests'].invoke
|
||||
end
|
||||
end
|
||||
|
||||
desc 'GitLab | Teaspoon | Shortcut for teaspoon:fixtures and teaspoon:tests'
|
||||
task :teaspoon do
|
||||
Rake::Task['teaspoon:fixtures'].invoke
|
||||
Rake::Task['teaspoon:tests'].invoke
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue