Sha256: fb958c44916ec44c6d2162fe767fdc196a0e7670945839172ae240f69f41ecff

Contents?: true

Size: 1.64 KB

Versions: 27

Compression:

Stored size: 1.64 KB

Contents

require "rspec/core/rake_task"

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

    t.rcov = RCOV_ENABLED
    t.rcov_opts = [
      '--exclude', 'lib\\/compat',
      '--exclude', 'spec',
      '--exclude', '\\.rvm\\/gems',
      '--exclude', '1\\.8\\/gems',
      '--exclude', '1\\.9\\/gems',
      '--exclude', '\\.rvm',
      '--exclude', '\\/Library\\/Ruby',
      '--exclude', 'addressable\\/idna' # environment dependant
    ]
  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"

task "clobber" => ["spec:clobber_rcov"]

Version data entries

27 entries across 18 versions & 6 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/addressable-2.3.6/tasks/rspec.rake
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/addressable-2.3.6/tasks/rspec.rake
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/addressable-2.3.6/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/addressable-2.3.6/tasks/rspec.rake
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/addressable-2.3.5/tasks/rspec.rake
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/addressable-2.3.6/tasks/rspec.rake
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/addressable-2.3.5/tasks/rspec.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/addressable-2.3.6/tasks/rspec.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/addressable-2.3.5/tasks/rspec.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/addressable-2.3.6/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/addressable-2.3.5/tasks/rspec.rake
whos_dated_who-0.1.0 vendor/bundle/gems/addressable-2.3.6/tasks/rspec.rake
whos_dated_who-0.0.1 vendor/bundle/gems/addressable-2.3.6/tasks/rspec.rake
addressable-2.3.6 tasks/rspec.rake
addressable-2.3.5 tasks/rspec.rake
addressable-2.3.4 tasks/rspec.rake
addressable-2.3.3 tasks/rspec.rake
simple-client-0.0.3 vendor/bundle/ruby/1.9.1/gems/addressable-2.2.8/tasks/rspec.rake
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/addressable-2.3.2/tasks/rspec.rake
simple-client-0.0.2 vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/rspec.rake