integrate with rails rake tasks instead of having own rakefile, solves RAILS_ROOT issue

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@160 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
rkh 15 years ago
parent 6b64866060
commit 98863e4fb8
  1. 16
      Rakefile
  2. 8
      spec/spec_helper.rb
  3. 11
      tasks/spec.rake

@ -1,16 +0,0 @@
require "spec/rake/spectask"
require "rake/clean"
require "rake/rdoctask"
task :default => :spec
task :test => :spec
Rake::RDocTask.new("rdoc") do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.options += %w[--all --inline-source --line-numbers --main README.rdoc --quiet --tab-width 2]
rdoc.rdoc_files.add Dir['*.{rdoc,rb}', '{app,lib}/**/*.rb']
end
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = Dir.glob 'spec/**/*_spec.rb'
end

@ -1,7 +1,5 @@
begin
unless defined? RAILS_ROOT
RAILS_ROOT = ENV["RAILS_ROOT"].dup || File.expand_path(File.dirname(__FILE__) + "../../..")
end
RAILS_ROOT = File.expand_path(".") unless defined? RAILS_ROOT
require RAILS_ROOT + '/spec/spec_helper'
rescue LoadError => error
puts <<-EOS
@ -11,10 +9,6 @@ rescue LoadError => error
gem install rspec-rails
script/generate rspec
Or if you have some issues due to symbolic links, try this:
RAILS_ROOT=/path/to/rails rake
EOS
raise error

@ -0,0 +1,11 @@
require "spec/rake/spectask"
namespace :spec do
namespace :plugins do
Spec::Rake::SpecTask.new('redmine_costs') do |t|
t.spec_files = Dir.glob "#{File.dirname __FILE__}/../spec/**/*_spec.rb"
end
end
end
task :spec => "spec:plugins:redmine_costs"
Loading…
Cancel
Save