mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
87b3e226d6
This reverts commit3420a14590
, reversing changes made toafb66a5a59
.
25 lines
545 B
Ruby
25 lines
545 B
Ruby
require "abstract_unit"
|
|
|
|
class EngineTest < ActiveSupport::TestCase
|
|
test "reports routes as available only if they're actually present" do
|
|
engine = Class.new(Rails::Engine) do
|
|
def initialize(*args)
|
|
@routes = nil
|
|
super
|
|
end
|
|
end
|
|
|
|
assert !engine.routes?
|
|
end
|
|
|
|
def test_application_can_be_subclassed
|
|
klass = Class.new(Rails::Application) do
|
|
attr_reader :hello
|
|
def initialize
|
|
@hello = "world"
|
|
super
|
|
end
|
|
end
|
|
assert_equal "world", klass.instance.hello
|
|
end
|
|
end
|