aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-11-15 20:25:14 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2008-11-15 20:25:14 -0800
commitd7bad6e2eba5b5ea0d83a4a2a4390b057c39ec7a (patch)
treec22938f72fb2c26d3208ad44465df287e1b477c2 /activemodel/test
parent9e9dde617f45c24c2cf3193f639b2a9eb0332a34 (diff)
downloadrails-d7bad6e2eba5b5ea0d83a4a2a4390b057c39ec7a.tar.gz
rails-d7bad6e2eba5b5ea0d83a4a2a4390b057c39ec7a.tar.bz2
rails-d7bad6e2eba5b5ea0d83a4a2a4390b057c39ec7a.zip
Use the Ruby load path for test_helper requires. Fix AM::TestCase.
Diffstat (limited to 'activemodel/test')
-rw-r--r--activemodel/test/observing_test.rb4
-rw-r--r--activemodel/test/state_machine/event_test.rb2
-rw-r--r--activemodel/test/state_machine/machine_test.rb4
-rw-r--r--activemodel/test/state_machine/state_test.rb4
-rw-r--r--activemodel/test/state_machine/state_transition_test.rb2
-rw-r--r--activemodel/test/state_machine_test.rb4
-rw-r--r--activemodel/test/test_helper.rb13
7 files changed, 12 insertions, 21 deletions
diff --git a/activemodel/test/observing_test.rb b/activemodel/test/observing_test.rb
index 6e124de52f..34bf260d69 100644
--- a/activemodel/test/observing_test.rb
+++ b/activemodel/test/observing_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper'))
+require 'test_helper'
class ObservedModel < ActiveModel::Base
class Observer
@@ -120,4 +120,4 @@ class ObserverTest < ActiveModel::TestCase
Foo.send(:changed)
Foo.send(:notify_observers, :whatever, foo)
end
-end \ No newline at end of file
+end
diff --git a/activemodel/test/state_machine/event_test.rb b/activemodel/test/state_machine/event_test.rb
index 40b630da7c..7f4a9afdd8 100644
--- a/activemodel/test/state_machine/event_test.rb
+++ b/activemodel/test/state_machine/event_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper'))
+require 'test_helper'
class EventTest < ActiveModel::TestCase
def setup
diff --git a/activemodel/test/state_machine/machine_test.rb b/activemodel/test/state_machine/machine_test.rb
index 2cdfcd9554..d23c223160 100644
--- a/activemodel/test/state_machine/machine_test.rb
+++ b/activemodel/test/state_machine/machine_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper'))
+require 'test_helper'
class MachineTestSubject
include ActiveModel::StateMachine
@@ -40,4 +40,4 @@ class StateMachineMachineTest < ActiveModel::TestCase
assert events.include?(:shutdown)
assert events.include?(:timeout)
end
-end \ No newline at end of file
+end
diff --git a/activemodel/test/state_machine/state_test.rb b/activemodel/test/state_machine/state_test.rb
index 22d0d9eb93..daaf0829f0 100644
--- a/activemodel/test/state_machine/state_test.rb
+++ b/activemodel/test/state_machine/state_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper'))
+require 'test_helper'
class StateTestSubject
include ActiveModel::StateMachine
@@ -71,4 +71,4 @@ class StateTest < ActiveModel::TestCase
state.call_action(:entering, record)
end
end
-end \ No newline at end of file
+end
diff --git a/activemodel/test/state_machine/state_transition_test.rb b/activemodel/test/state_machine/state_transition_test.rb
index 9a9e7f60c5..5165bb1c97 100644
--- a/activemodel/test/state_machine/state_transition_test.rb
+++ b/activemodel/test/state_machine/state_transition_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper'))
+require 'test_helper'
class StateTransitionTest < ActiveModel::TestCase
test 'should set from, to, and opts attr readers' do
diff --git a/activemodel/test/state_machine_test.rb b/activemodel/test/state_machine_test.rb
index b2f0fc4ec0..fb150671e0 100644
--- a/activemodel/test/state_machine_test.rb
+++ b/activemodel/test/state_machine_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper'))
+require 'test_helper'
class StateMachineSubject
include ActiveModel::StateMachine
@@ -321,4 +321,4 @@ class StateMachineWithComplexTransitionsTest < ActiveModel::TestCase
@subj.dress!(:dating, 'purple', 'slacks')
end
end
-end \ No newline at end of file
+end
diff --git a/activemodel/test/test_helper.rb b/activemodel/test/test_helper.rb
index ccf93280ec..6c10925270 100644
--- a/activemodel/test/test_helper.rb
+++ b/activemodel/test/test_helper.rb
@@ -1,10 +1,6 @@
-$:.unshift "#{File.dirname(__FILE__)}/../lib"
-$:.unshift File.dirname(__FILE__)
-
require 'test/unit'
require 'active_model'
require 'active_model/state_machine'
-require 'active_support/callbacks' # needed by ActiveModel::TestCase
require 'active_support/test_case'
def uses_gem(gem_name, test_name, version = '> 0')
@@ -30,10 +26,5 @@ begin
rescue LoadError
end
-ActiveSupport::TestCase.send :include, ActiveSupport::Testing::Default
-
-module ActiveModel
- class TestCase < ActiveSupport::TestCase
- include ActiveSupport::Testing::Default
- end
-end \ No newline at end of file
+class ActiveModel::TestCase < ActiveSupport::TestCase
+end