BigW Consortium Gitlab

teaspoon.rake 800 Bytes
Newer Older
1 2
unless Rails.env.production?
  Rake::Task['teaspoon'].clear if Rake::Task.task_defined?('teaspoon')
3

4 5 6 7 8 9 10
  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
11

12 13 14 15 16 17
    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
18 19
  end

20 21 22 23 24
  desc 'GitLab | Teaspoon | Shortcut for teaspoon:fixtures and teaspoon:tests'
  task :teaspoon do
    Rake::Task['teaspoon:fixtures'].invoke
    Rake::Task['teaspoon:tests'].invoke
  end
25
end