Sha256: bb92ea4398091d5ba7d838e04660e78127e8a6283294ba02c29e2ad012413b2c

Contents?: true

Size: 1.55 KB

Versions: 2

Compression:

Stored size: 1.55 KB

Contents

ENV['BUNDLE_GEMFILE'] = File.dirname(__FILE__) + '/../spec/rails_3_0_1_root/Gemfile'

require 'rake'
require 'rake/testtask'
require 'rspec'
require 'rspec/core/rake_task'


desc "Run the test suite"
task :spec => ['spec:setup', 'spec:rules_view', 'spec:cleanup']

namespace :spec do
  desc "Setup the test environment"
  task :setup do
    rails_path = File.expand_path(File.dirname(__FILE__) + '/../spec/rails_3_0_1_root')

    system "cd #{rails_path} && bundle install"
    system "cd #{rails_path} && ./script/rails generate rules_engine:install"
  end
  
  desc "Cleanup the test environment"
  task :cleanup do
    rails_path = File.expand_path(File.dirname(__FILE__) + '/../spec/rails_3_0_1_root')
    
    FileUtils.rm_rf("#{rails_path}/public/stylesheets/rules_view")
    FileUtils.rm_rf("#{rails_path}/public/javascripts/rules_view")
    FileUtils.rm_rf("#{rails_path}/config/initializers/rules_view.rb")
    FileUtils.rm_rf("#{rails_path}/doc/README.rules_view")
    FileUtils.rm_rf("#{rails_path}/Gemfile.lock")
  end

  desc "Test the rules_view"
  RSpec::Core::RakeTask.new(:rules_view) do |task|
    rules_engine_root = File.expand_path(File.dirname(__FILE__) + '/..')
    task.pattern = rules_engine_root + '/spec/lib/rules_view/**/*_spec.rb'
  end

  desc "Run the coverage report"
  RSpec::Core::RakeTask.new(:rcov) do |task|
    rules_engine_root = File.expand_path(File.dirname(__FILE__) + '/..')
    task.pattern = rules_engine_root + '/spec/lib/**/*_spec.rb'
    task.rcov=true
    task.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/,features\/}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rules_view-0.0.3 tasks/rspec.rake
rules_view-0.0.2 tasks/rspec.rake