Sha256: bcbf01656525d064b4f0766dcb234d918ce3b2d4257889ee2dd22cffe5ad4fbd

Contents?: true

Size: 1.77 KB

Versions: 34

Compression:

Stored size: 1.77 KB

Contents

APP_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../") unless defined?(APP_ROOT)

require 'jettywrapper'
JETTY_ZIP_BASENAME = 'fedora-3.8.1-with-risearch'
Jettywrapper.url = "https://github.com/cul/hydra-jetty/archive/#{JETTY_ZIP_BASENAME}.zip"

namespace :cul_hydra do

  begin
    # This code is in a begin/rescue block so that the Rakefile is usable
    # in an environment where RSpec is unavailable (i.e. production).

    require 'rspec/core/rake_task'

    RSpec::Core::RakeTask.new(:rspec) do |spec|
      spec.pattern = FileList['spec/**/*_spec.rb']
      spec.pattern += FileList['spec/*_spec.rb']
      spec.rspec_opts = ['--backtrace'] if ENV['CI']
    end

    RSpec::Core::RakeTask.new(:rcov) do |spec|
      spec.pattern = FileList['spec/**/*_spec.rb']
      spec.pattern += FileList['spec/*_spec.rb']
      spec.rcov = true
    end

  rescue LoadError => e
    puts "[Warning] Exception creating rspec rake tasks.  This message can be ignored in environments that intentionally do not pull in the RSpec gem (i.e. production)."
    puts e
  end

  desc "CI build"
  task :ci do
    ENV['environment'] = "test"
    #Rake::Task["active_fedora:configure_jetty"].invoke
    jetty_params = Jettywrapper.load_config
    Rake::Task["jetty:clean"].invoke
    error = Jettywrapper.wrap(jetty_params) do
      Rake::Task["cul_hydra:cmodel:reload_all"].invoke
      Rake::Task['cul_hydra:coverage'].invoke
    end
    raise "test failures: #{error}" if error
  end

  desc "Execute specs with coverage"
  task :coverage do
    # Put spec opts in a file named .rspec in root
    ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
    ENV['COVERAGE'] = 'true' unless ruby_engine == 'jruby'

   # Rake::Task["active_fedora:fixtures"].invoke
    Rake::Task["cul_hydra:rspec"].invoke
  end

end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
cul_hydra-1.4.14 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.13 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.12 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.11 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.10 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.8 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.7 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.5 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.4 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.3 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.2 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.1 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.4.0 lib/tasks/cul_hydra_dev.rake
cul_hydra-1.3.11 lib/tasks/cul_hydra_dev.rake