Sha256: 688a1f721e04426775f130c5cd604c8768936e8ea6a50a7d9917b08bdc5f6e23

Contents?: true

Size: 1.92 KB

Versions: 9

Compression:

Stored size: 1.92 KB

Contents

gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9

# Don't load rspec if running "rake gems:*"
unless ARGV.any? {|a| a =~ /^gems/}

begin
  require 'spec/rake/spectask'
rescue MissingSourceFile
  module Spec
    module Rake
      class SpecTask
        def initialize(name)
          task name do
            # if rspec-rails is a configured gem, this will output helpful material and exit ...
            require File.expand_path(File.dirname(__FILE__) + "/../../config/environment")

            # ... otherwise, do this:
            raise <<-MSG

#{"*" * 80}
*  You are trying to run an rspec rake task defined in
*  #{__FILE__},
*  but rspec can not be found in vendor/gems, vendor/plugins or system gems.
#{"*" * 80}
MSG
          end
        end
      end
    end
  end
end

Rake.application.instance_variable_get('@tasks').delete('default')

spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
task :noop do
end

task :default => [:spec,:features]
task :stats => "spec:statsetup"

desc "Run all specs in spec directory (excluding plugin specs)"
Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
  t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
  t.spec_files = FileList['spec/**/*/*_spec.rb']
end

desc "Run all specs in the spec directory with html output (excluding plugins specs)"
Spec::Rake::SpecTask.new(:spec_html => spec_prereq) do |t|
  t.spec_opts = ['--colour', '--format html', '--loadby mtime', '--reverse']
  t.spec_files = FileList['spec/**/*/*_spec.rb']
end

namespace :spec do
  desc "Run all specs in spec directory with RCov (excluding plugin specs)"
  Spec::Rake::SpecTask.new(:rcov) do |t|
    t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
    t.spec_files = FileList['spec/**/*/*_spec.rb']
    t.rcov = true
    t.rcov_opts = lambda do
      IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
    end
  end
end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
culerity-0.2.15 lib/tasks/rspec.rake
culerity-0.2.14 lib/tasks/rspec.rake
culerity-0.2.13 lib/tasks/rspec.rake
culerity-0.2.12 lib/tasks/rspec.rake
culerity-0.2.10 lib/tasks/rspec.rake
fletcherm-culerity-0.2.9 lib/tasks/rspec.rake
culerity-0.2.9 lib/tasks/rspec.rake
fletcherm-culerity-0.2.8 lib/tasks/rspec.rake
culerity-0.2.8 lib/tasks/rspec.rake