mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use the Ruby load path for test_helper requires. Fix AM::TestCase.
This commit is contained in:
parent
9e9dde617f
commit
d7bad6e2eb
7 changed files with 12 additions and 21 deletions
|
@ -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
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper'))
|
||||
require 'test_helper'
|
||||
|
||||
class EventTest < ActiveModel::TestCase
|
||||
def setup
|
||||
|
|
|
@ -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
|
||||
end
|
||||
|
|
|
@ -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
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
end
|
||||
|
|
|
@ -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
|
||||
class ActiveModel::TestCase < ActiveSupport::TestCase
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue