rails/railties/test/engine_test.rb
Xavier Noria 783763bde9 applies new string literal convention in railties/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:16:09 +02:00

26 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