Skip to content
Browse files

Get tests to run on Rails 2.1 and 2.2

  • Loading branch information...
1 parent 507962a commit a0701d7456aced012432005e2e8a974739d68a61 @bkeepers bkeepers committed
Showing with 6 additions and 7 deletions.
  1. +2 −2 Rakefile
  2. +1 −0 test/application.rb
  3. +1 −1 test/awesome_nested_set/helper_test.rb
  4. +1 −1 test/awesome_nested_set_test.rb
  5. +1 −3 test/test_helper.rb
View
4 Rakefile
@@ -28,7 +28,7 @@ task :default => :test
desc 'Test the awesome_nested_set plugin.'
Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
+ t.libs += ['lib', 'test']
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
@@ -45,7 +45,7 @@ end
namespace :test do
desc "just rcov minus html output"
Rcov::RcovTask.new(:coverage) do |t|
- # t.libs << 'test'
+ t.libs << 'test'
t.test_files = FileList['test/**/*_test.rb']
t.output_dir = 'coverage'
t.verbose = true
View
1 test/application.rb
@@ -0,0 +1 @@
+# This file is here to satisfy test_help from Rails < 2.3
View
2 test/awesome_nested_set/helper_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
module CollectiveIdea
module Acts #:nodoc:
View
2 test/awesome_nested_set_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/test_helper'
+require 'test_helper'
class Note < ActiveRecord::Base
acts_as_nested_set :scope => [:notable_id, :notable_type]
View
4 test/test_helper.rb
@@ -1,12 +1,10 @@
$:.unshift(File.dirname(__FILE__) + '/../lib')
plugin_test_dir = File.dirname(__FILE__)
-
-RAILS_ROOT = '.' unless defined? RAILS_ROOT
+RAILS_ROOT = plugin_test_dir
require 'rubygems'
require 'test/unit'
require 'multi_rails_init'
-# FIXME: Rails 1.x needs application.rb in root.
require 'test_help'
require plugin_test_dir + '/../init.rb'

0 comments on commit a0701d7

Please sign in to comment.
Something went wrong with that request. Please try again.