Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…. (From David Yip)
  • Loading branch information...
commit 0cb5a04394fb4b34a2bd0187c3476a0c623f0355 1 parent 3c81ad8
@pat authored
View
2  Rakefile
@@ -1,5 +1,7 @@
require 'rubygems'
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+
require 'tasks/distribution'
require 'tasks/testing'
View
3  tasks/testing.rb
@@ -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
View
2  test/after_commit_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/test_helper'
+require 'test_helper'
class MockRecord < ActiveRecord::Base
attr_accessor :before_commit_on_create_called
View
2  test/observer_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/test_helper'
+require 'test_helper'
class ObservableMockRecord < ActiveRecord::Base
set_table_name 'mock_records'
Please sign in to comment.
Something went wrong with that request. Please try again.