test/unit/runner_tests.rb in deas-0.27.0 vs test/unit/runner_tests.rb in deas-0.28.0
- old
+ new
@@ -1,8 +1,9 @@
require 'assert'
require 'deas/runner'
+require 'deas/logger'
require 'deas/router'
require 'test/support/view_handlers'
class Deas::Runner
@@ -21,27 +22,28 @@
@runner = @runner_class.new(EmptyViewHandler)
end
subject{ @runner }
should have_readers :handler_class, :handler
- should have_readers :request, :response, :params
- should have_readers :logger, :router, :session
+ should have_readers :request, :response, :session
+ should have_readers :params, :logger, :router, :template_source
should have_imeths :halt, :redirect, :content_type, :status, :headers
- should have_imeths :render, :send_file
+ should have_imeths :render, :partial, :send_file
should "know its handler and handler class" do
assert_equal EmptyViewHandler, subject.handler_class
assert_instance_of subject.handler_class, subject.handler
end
should "default its settings" do
assert_nil subject.request
assert_nil subject.response
+ assert_nil subject.session
assert_kind_of ::Hash, subject.params
assert_kind_of Deas::NullLogger, subject.logger
assert_kind_of Deas::Router, subject.router
- assert_nil subject.session
+ assert_kind_of Deas::NullTemplateSource, subject.template_source
end
should "default its params" do
runner = @runner_class.new(TestRunnerViewHandler)
assert_equal ::Hash.new, runner.params
@@ -52,9 +54,10 @@
assert_raises(NotImplementedError){ subject.redirect }
assert_raises(NotImplementedError){ subject.content_type }
assert_raises(NotImplementedError){ subject.status }
assert_raises(NotImplementedError){ subject.headers }
assert_raises(NotImplementedError){ subject.render }
+ assert_raises(NotImplementedError){ subject.partial }
assert_raises(NotImplementedError){ subject.send_file }
end
end