rails/railties/test/engine_test.rb

26 lines
545 B
Ruby
Raw Normal View History

2012-04-28 22:05:49 +00:00
require 'abstract_unit'
class EngineTest < ActiveSupport::TestCase
test "reports routes as available only if they're actually present" do
2012-04-28 22:05:49 +00:00
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"
2014-08-07 23:03:09 +00:00
super
end
end
assert_equal "world", klass.instance.hello
end
2012-04-28 22:05:49 +00:00
end