Sha256: a833a2a0a1ed714a95c410ea9c8a88cca63801cdd101e75b5289947c6bcfb3fc

Contents?: true

Size: 1.05 KB

Versions: 6

Compression:

Stored size: 1.05 KB

Contents

begin
  require "rspec/core/rake_task"
  require "snowpack/test/suite"

  require Snowpack::Test::Suite.root.join("support/suite")
  suite = Snowpack::Test::Suite.current.new

  desc "Run all specs"
  RSpec::Core::RakeTask.new :spec do |t|
    opts = ["#{suite.root} --pattern **/*_spec.rb"]

    if suite.ci?
      opts << "--format RspecJunitFormatter"
      opts << "--out /tmp/test-results/rspec.xml"
      opts << "--format progress"
    end

    t.rspec_opts = opts.join(" ")
  end

  namespace :spec do
    suite.groups.each do |group|
      desc "Run #{group} specs"
      RSpec::Core::RakeTask.new(group) do |t|
        t.rspec_opts = "#{suite.chdir(group).root} --pattern **/*_spec.rb"
      end
    end

    desc 'Verify coverage'
    task :verify_coverage do
      if suite.current_coverage.to_i < suite.coverage_threshold
        puts "Coverage too low. Current: #{suite.current_coverage}%; Expected min: #{suite.coverage_threshold}%"
        exit 1
      end
    end
  end

  task default: [:spec]
rescue LoadError; end
# FIXME ^ make that way more specific

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
snowpack-1.0.0.alpha7 lib/snowpack/test/tasks.rake
snowpack-1.0.0.alpha6 lib/snowpack/test/tasks.rake
snowpack-1.0.0.alpha5 lib/snowpack/test/tasks.rake
snowpack-1.0.0.alpha4 lib/snowpack/test/tasks.rake
snowpack-1.0.0.alpha3 lib/snowpack/test/tasks.rake
snowpack-1.0.0.alpha2 lib/snowpack/test/tasks.rake