Sha256: 250afc3c2b3e6940b5ab32c21aa3e1b1f672f3a763266e3d2ee75f12445ed17d

Contents?: true

Size: 1.35 KB

Versions: 38

Compression:

Stored size: 1.35 KB

Contents

namespace :spec do
  Spec::Rake::SpecTask.new(:rcov) do |t|
    t.libs = %w[lib spec]
    t.spec_files = FileList['spec/**/*_spec.rb']
    t.spec_opts = ['--color', '--format', 'specdoc']
    
    t.rcov = RCOV_ENABLED
    t.rcov_opts = [
      '--exclude', 'spec',
      '--exclude', '1\\.8\\/gems',
      '--exclude', '1\\.9\\/gems',
      '--exclude', 'addressable\\/idna\\.rb', # unicode tables too big
    ]
  end

  Spec::Rake::SpecTask.new(:normal) do |t|
    t.libs = %w[lib spec]
    t.spec_files = FileList['spec/**/*_spec.rb']
    t.spec_opts = ['--color', '--format', 'specdoc']
    t.rcov = false
  end

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

    output_file = File.join(specdoc_path, 'index.html')
    t.libs = %w[lib spec]
    t.spec_files = FileList['spec/**/*_spec.rb']
    t.spec_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

38 entries across 38 versions & 5 rubygems

Version Path
abiquo-etk-0.4.23 vendor/addressable-2.2.1/tasks/spec.rake
abiquo-etk-0.4.22 vendor/addressable-2.2.1/tasks/spec.rake
abiquo-etk-0.4.20 vendor/addressable-2.2.1/tasks/spec.rake
abiquo-etk-0.4.19 vendor/addressable-2.2.1/tasks/spec.rake
abiquo-etk-0.4.18 vendor/addressable-2.2.1/tasks/spec.rake
abiquo-etk-0.4.17 vendor/addressable-2.2.1/tasks/spec.rake
abiquo-etk-0.4.16 vendor/addressable-2.2.1/tasks/spec.rake
abiquo-etk-0.4.15 vendor/addressable-2.2.1/tasks/spec.rake
abiquo-etk-0.4.14 vendor/addressable-2.2.1/tasks/spec.rake
abiquo-etk-0.4.13 vendor/addressable-2.2.1/tasks/spec.rake
addressable-2.2.2 tasks/spec.rake
addressable-2.2.1 tasks/spec.rake
addressable-2.2.0 tasks/spec.rake
cerberus-0.7.8 lib/vendor/addressable/tasks/spec.rake
cerberus-0.7.7 lib/vendor/addressable/tasks/spec.rake
addressable-2.1.2 tasks/spec.rake
honkster-addressable-2.1.2 tasks/spec.rake
addressable-2.1.1 tasks/spec.rake