Permalink
Browse files

Ruby 1.9 compatibility fixes: fix load paths for Rake tasks and tests…

…. (From David Yip)
  • Loading branch information...
1 parent 3c81ad8 commit 0cb5a04394fb4b34a2bd0187c3476a0c623f0355 @pat committed Dec 14, 2009
Showing with 7 additions and 2 deletions.
  1. +2 −0 Rakefile
  2. +3 −0 tasks/testing.rb
  3. +1 −1 test/after_commit_test.rb
  4. +1 −1 test/observer_test.rb
View
@@ -1,5 +1,7 @@
require 'rubygems'
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+
require 'tasks/distribution'
require 'tasks/testing'
View
@@ -2,9 +2,12 @@
desc 'Test the after_commit plugin.'
Rake::TestTask.new(:test) do |t|
+ test_dir = File.expand_path(File.join(File.dirname(__FILE__), %w(.. test)))
+
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
+ t.ruby_opts = ["-I#{test_dir}"]
end
task :test => :check_dependencies
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/test_helper'
+require 'test_helper'
class MockRecord < ActiveRecord::Base
attr_accessor :before_commit_on_create_called
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/test_helper'
+require 'test_helper'
class ObservableMockRecord < ActiveRecord::Base
set_table_name 'mock_records'

0 comments on commit 0cb5a04

Please sign in to comment.