Sha256: 40aedcb7faae0aa002f5f36b16e6dd44608a58e90602c9a043e3df799097c9bc

Contents?: true

Size: 1.59 KB

Versions: 7

Compression:

Stored size: 1.59 KB

Contents

require "rspec/core/rake_task"
require "rake/clean"

CLOBBER.include("coverage", "specdoc")

namespace :spec do
  RSpec::Core::RakeTask.new(:rcov) do |t|
    t.pattern = FileList['spec/**/*_spec.rb']
    t.rspec_opts = ['--color', '--format', 'documentation']

    t.rcov = true
    t.rcov_opts = [
      '--exclude', 'lib\\/compat',
      '--exclude', 'spec',
      '--exclude', '\\.rvm\\/gems',
      '--exclude', '1\\.8\\/gems',
      '--exclude', '1\\.9\\/gems',
      '--exclude', '\\.rvm',
      '--exclude', '\\/Library\\/Ruby'
    ]
  end

  RSpec::Core::RakeTask.new(:normal) do |t|
    t.pattern = FileList['spec/**/*_spec.rb'].exclude(/compat/)
    t.rspec_opts = ['--color', '--format', 'documentation']
    t.rcov = false
  end

  RSpec::Core::RakeTask.new(:all) do |t|
    t.pattern = FileList['spec/**/*_spec.rb']
    t.rspec_opts = ['--color', '--format', 'documentation']
    t.rcov = false
  end

  desc "Generate HTML Specdocs for all specs"
  RSpec::Core::RakeTask.new(:specdoc) do |t|
    specdoc_path = File.expand_path(
      File.join(File.dirname(__FILE__), '..', 'documentation')
    )
    Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)

    output_file = File.join(specdoc_path, 'index.html')
    t.pattern = FileList['spec/**/*_spec.rb']
    t.rspec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
    t.fail_on_error = false
  end

  namespace :rcov do
    desc "Browse the code coverage report."
    task :browse => "spec:rcov" do
      require "launchy"
      Launchy::Browser.run("coverage/index.html")
    end
  end
end

desc "Alias to spec:normal"
task "spec" => "spec:normal"

Version data entries

7 entries across 4 versions & 3 rubygems

Version Path
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/uuidtools-2.1.4/tasks/rspec.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/uuidtools-2.1.4/tasks/rspec.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/uuidtools-2.1.4/tasks/rspec.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/uuidtools-2.1.4/tasks/rspec.rake
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/uuidtools-2.1.4/tasks/rspec.rake
uuidtools-2.1.4 tasks/rspec.rake
uuidtools-2.1.3 tasks/rspec.rake