Sha256: 7ef342862d30eaf9dfb6a62ff12d611921e5f07aa448564d742ca19176da6f47

Contents?: true

Size: 904 Bytes

Versions: 1

Compression:

Stored size: 904 Bytes

Contents

begin
  require 'rspec/core/rake_task'

  desc 'run all specs'
  task :spec => ['spec:unit', 'spec:integration', 'spec:examples']

  namespace :spec do
    RSpec::Core::RakeTask.new(:examples) do |t|
      t.pattern = 'examples/**/*_spec.rb'
    end

    RSpec::Core::RakeTask.new(:integration) do |t|
      t.pattern = 'spec/integration/**/*_spec.rb'
    end

    RSpec::Core::RakeTask.new(:unit) do |t|
      t.pattern = 'spec/unit/**/*_spec.rb'
    end
  end
rescue LoadError
  task :spec do
    abort 'rspec is not available. In order to run spec, you must: gem install rspec'
  end
end

begin
  desc "Generate code coverage"
  RSpec::Core::RakeTask.new(:rcov) do |t|
    t.rcov = true
    t.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
  end
rescue LoadError
  task :rcov do
    abort 'rcov is not available. In order to run rcov, you must: gem install rcov'
  end
end

task :test => 'spec'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
virtus-0.0.10 tasks/spec.rake