Sha256: eb0bd06681eaf1be19bbf08180f28ef1f691ac3495c8bdf08a4a62a9e7bf6251

Contents?: true

Size: 1.97 KB

Versions: 10

Compression:

Stored size: 1.97 KB

Contents

desc "Creates a test rails app for the specs to run against"
task :setup do
  require 'rails/version'
  system("mkdir spec/rails") unless File.exists?("spec/rails")
  system "bundle exec rails new spec/rails/rails-#{Rails::VERSION::STRING} -m spec/support/rails_template.rb"
  Rake::Task['parallel:after_setup_hook'].invoke
end

desc "Run the full suite using 1 core"
task test: ['spec:unit', 'spec:integration', 'cucumber', 'cucumber:class_reloading']

require 'coveralls/rake/task'
Coveralls::RakeTask.new
task test_with_coveralls: [:test, 'coveralls:push']

namespace :test do

  def run_tests_against(*versions)
    current_version = detect_rails_version if File.exists?("Gemfile.lock")

    versions.each do |version|
      puts
      puts "== Using Rails #{version}"

      cmd "./script/use_rails #{version}"
      cmd "bundle exec rspec spec"
      cmd "bundle exec cucumber features"
      cmd "bundle exec cucumber -p class-reloading features"
    end

    cmd "./script/use_rails #{current_version}" if current_version
  end

  desc "Run the full suite against the important versions of rails"
  task :major_supported_rails do
    run_tests_against *TRAVIS_RAILS_VERSIONS
  end

  desc "Alias for major_supported_rails"
  task :all => :major_supported_rails

end

require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

namespace :spec do

  desc "Run the unit specs"
  RSpec::Core::RakeTask.new(:unit) do |t|
    t.pattern = "spec/unit/**/*_spec.rb"
  end

  desc "Run the integration specs"
  RSpec::Core::RakeTask.new(:integration) do |t|
    t.pattern = "spec/integration/**/*_spec.rb"
  end

end


require 'cucumber/rake/task'

Cucumber::Rake::Task.new(:cucumber) do |t|
  t.profile = 'default'
end

namespace :cucumber do

  Cucumber::Rake::Task.new(:wip, "Run the cucumber scenarios with the @wip tag") do |t|
    t.profile = 'wip'
  end

  Cucumber::Rake::Task.new(:class_reloading, "Run the cucumber scenarios that test reloading") do |t|
    t.profile = 'class-reloading'
  end

end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
yousty-activeadmin-1.0.4.pre tasks/test.rake
yousty-activeadmin-1.0.3.pre tasks/test.rake
active_administration-0.0.3 tasks/test.rake
activeadministration-0.0.2 tasks/test.rake
active_administration-0.0.2 tasks/test.rake
activeadministration-0.0.1 tasks/test.rake
active_administration-0.0.1 tasks/test.rake
yousty-activeadmin-1.0.2.pre tasks/test.rake
yousty-activeadmin-1.0.1.pre tasks/test.rake
yousty-activeadmin-1.0.0.pre tasks/test.rake