test/unit/runner_tests.rb in deas-0.23.4 vs test/unit/runner_tests.rb in deas-0.24.0
- old
+ new
@@ -1,48 +1,45 @@
require 'assert'
-require 'test/support/view_handlers'
require 'deas/runner'
+require 'test/support/view_handlers'
+
class Deas::Runner
class BaseTests < Assert::Context
desc "Deas::Runner"
setup do
@runner = Deas::Runner.new(TestViewHandler)
end
subject{ @runner }
- should have_reader :app_settings
+ should have_readers :handler_class, :handler
should have_readers :request, :response, :params, :logger, :session
- should have_imeths :halt, :redirect, :content_type, :status
- should have_imeths :render, :send_file
+ should have_imeths :halt, :redirect, :content_type, :status, :headers
+ should have_imeths :render, :partial, :send_file
- should "raise NotImplementedError with #send_file" do
- assert_raises(NotImplementedError){ subject.send_file }
+ should "know its handler and handler class" do
+ assert_equal TestViewHandler, subject.handler_class
+ assert_instance_of subject.handler_class, subject.handler
end
- should "raise NotImplementedError with #halt" do
- assert_raises(NotImplementedError){ subject.halt }
+ should "not set any settings" do
+ assert_nil subject.request
+ assert_nil subject.response
+ assert_nil subject.params
+ assert_nil subject.logger
+ assert_nil subject.session
end
- should "raise NotImplementedError with #redirect" do
+ should "not implement any actions" do
+ assert_raises(NotImplementedError){ subject.halt }
assert_raises(NotImplementedError){ subject.redirect }
- end
-
- should "raise NotImplementedError with #content_type" do
assert_raises(NotImplementedError){ subject.content_type }
- end
-
- should "raise NotImplementedError with #status" do
assert_raises(NotImplementedError){ subject.status }
- end
-
- should "raise NotImplementedError with #headers" do
assert_raises(NotImplementedError){ subject.headers }
- end
-
- should "raise NotImplementedError with #render" do
assert_raises(NotImplementedError){ subject.render }
+ assert_raises(NotImplementedError){ subject.partial }
+ assert_raises(NotImplementedError){ subject.send_file }
end
end
end