Sha256: bd3dc6b17c5ab79065bdeaa74cf6045fc57c9e8b9a6bd153299902074713fa61
Contents?: true
Size: 925 Bytes
Versions: 8
Compression:
Stored size: 925 Bytes
Contents
require 'assert' require 'deas/route' require 'deas/sinatra_runner' require 'test/support/fake_app' require 'test/support/view_handlers' class Deas::Route class BaseTests < Assert::Context desc "Deas::Route" setup do @route = Deas::Route.new(:get, '/test', 'TestViewHandler') end subject{ @route } should have_instance_methods :method, :path, :handler_class_name, :handler_class, :run should "constantize the handler class with #constantize!" do assert_nil subject.handler_class assert_nothing_raised{ subject.constantize! } assert_equal TestViewHandler, subject.handler_class end should "raise a custom exception if the handler class name " \ "can't be constantized" do route = Deas::Route.new(:get, '/', 'SomethingNotDefined') assert_raises(Deas::NoHandlerClassError) do route.constantize! end end end end
Version data entries
8 entries across 8 versions & 1 rubygems