<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/merb-core/dispatch/default_exception/default_exception.rb</filename>
    </added>
    <added>
      <filename>lib/merb-core/dispatch/default_exception/views/_css.html.erb</filename>
    </added>
    <added>
      <filename>lib/merb-core/dispatch/default_exception/views/_javascript.html.erb</filename>
    </added>
    <added>
      <filename>lib/merb-core/dispatch/default_exception/views/index.html.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -20,8 +20,6 @@ class Merb::Controller &lt; Merb::AbstractController
   include Merb::ControllerMixin
   include Merb::AuthenticationMixin
 
-  attr_accessor :route
-
   class &lt;&lt; self
 
     # ==== Parameters
@@ -202,6 +200,7 @@ class Merb::Controller &lt; Merb::AbstractController
       raise ActionNotFound, &quot;Action '#{action}' was not found in #{self.class}&quot;
     end
     @_benchmarks[:action_time] = Time.now - start
+    self
   end
 
   attr_reader :request, :headers
@@ -242,6 +241,15 @@ class Merb::Controller &lt; Merb::AbstractController
   # Hash:: The session that was extracted from the request object.
   def session() request.session end
   
+  # The results of the controller's render, to be returned to Rack.
+  #
+  # ==== Returns
+  # Array[Integer, Hash, String]::
+  #   The controller's status code, headers, and body
+  def rack_response
+    [status, headers, body]
+  end
+  
   # Hide any methods that may have been exposed as actions before.
   hide_action(*_callable_methods)
   
@@ -258,8 +266,8 @@ class Merb::Controller &lt; Merb::AbstractController
   end
 end
 
-module Merb::ExceptionsHelper
-  def humanize_exception(e)
-    e.class.name.split(&quot;::&quot;).last.gsub(/([a-z])([A-Z])/, '\1 \2')
-  end
-end
+# module Merb::ExceptionsHelper
+#   def humanize_exception(e)
+#     e.class.name.split(&quot;::&quot;).last.gsub(/([a-z])([A-Z])/, '\1 \2')
+#   end
+# end</diff>
      <filename>lib/merb-core/controller/merb_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -216,26 +216,40 @@ module Kernel
   #       [ 124, &quot;      @suspend_next = false&quot;,                       false ]
   #     ]
   def __caller_lines__(file, line, size = 4)
-    return [['Template Error!', &quot;problem while rendering&quot;, false]] if file =~ /\(erubis\)/
-    lines = File.readlines(file)
-    current = line.to_i - 1
-
-    first = current - size
-    first = first &lt; 0 ? 0 : first
-
-    last = current + size
-    last = last &gt; lines.size ? lines.size : last
-
-    log = lines[first..last]
-
-    area = []
-
-    log.each_with_index do |line, index|
-      index = index + first + 1
-      area &lt;&lt; [index, line.chomp, index == current + 1]
+    line = line.to_i
+    if file =~ /\(erubis\)/
+      yield :error, &quot;Template Error! Problem while rendering&quot;, false
+    elsif !File.file?(file) || !File.readable?(file)
+      yield :error, &quot;File `#{file}' not available&quot;, false
+    else
+      lines = File.read(file).split(&quot;\n&quot;)
+      first_line = (f = line - size - 1) &lt; 0 ? 0 : f
+      lines = lines[first_line, size * 2 + 1]
+      
+      lines.each_with_index do |str, index|
+        yield index + line - size, str.chomp
+      end
     end
-
-    area
+    # 
+    # lines = File.readlines(file)
+    # current = line.to_i - 1
+    # 
+    # first = current - size
+    # first = first &lt; 0 ? 0 : first
+    # 
+    # last = current + size
+    # last = last &gt; lines.size ? lines.size : last
+    # 
+    # log = lines[first..last]
+    # 
+    # area = []
+    # 
+    # log.each_with_index do |line, index|
+    #   index = index + first + 1
+    #   area &lt;&lt; [index, line.chomp, index == current + 1]
+    # end
+    # 
+    # area
   end
 
   # Takes a block, profiles the results of running the block</diff>
      <filename>lib/merb-core/core_ext/kernel.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,6 @@
+require Merb.framework_root / &quot;merb-core&quot; / &quot;dispatch&quot; / &quot;default_exception&quot; / &quot;default_exception&quot;
 module Merb
   class Dispatcher
-    DEFAULT_ERROR_TEMPLATE = File.expand_path(File.dirname(__FILE__) / 'exceptions.html')
-  
     class &lt;&lt; self
       include Merb::ControllerExceptions
     
@@ -16,36 +15,26 @@ module Merb
     
       Merb::Dispatcher.use_mutex = ::Merb::Config[:use_mutex]
     
-      # This is where we grab the incoming request REQUEST_URI and use that in
-      # the merb RouteMatcher to determine which controller and method to run.
-      # Returns a 2 element tuple of: [controller, action]
-      #
-      # ControllerExceptions are rescued here and redispatched.
+      # Dispatch the rack environment. ControllerExceptions are rescued here
+      # and redispatched.
       #
       # ==== Parameters
       # rack_env&lt;Rack::Environment&gt;::
       #   The rack environment, which is used to instantiate a Merb::Request
-      # response&lt;IO&gt;::
-      #   An IO object to hold the response
       #
       # ==== Returns
-      # Array[Merb::Controller, Symbol]::
-      #   An array containing the Merb::Controller and the action that was
-      #   dispatched to.
-      def handle(rack_env)
+      # Merb::Controller::
+      #   The Merb::Controller that was dispatched to
+      def handle(request)
         start = Time.now
         Merb.logger.info &quot;Started request handling: #{start.to_s}&quot;
     
-        request = Merb::Request.new(rack_env)
-      
-        route, params = Merb::Router.route_for(request)
-        return redirect(request, route) if route.redirects?
-        request.route_params = params
-
+        request.find_route
+        return redirect(request) if request.redirects?
+        
         klass = request.controller
-    
-        Merb.logger.debug(&quot;Routed to: #{params.inspect}&quot;)
-      
+        Merb.logger.debug(&quot;Routed to: #{request.params.inspect}&quot;)
+        
         unless klass &lt; Controller
           raise NotFound, 
             &quot;Controller '#{klass}' not found.\n&quot; &lt;&lt;
@@ -59,13 +48,13 @@ module Merb
         end
       
         # TODO: move fixation logic to session loading
-        controller = dispatch_action(klass, request, route)
+        controller = dispatch_action(klass, request.params[:action], request)
         controller._benchmarks[:dispatch_time] = Time.now - start
         Merb.logger.info controller._benchmarks.inspect
         Merb.logger.flush
         controller
       rescue Object =&gt; exception
-        dispatch_exception(request, exception, route)
+        dispatch_exception(exception, request)
       end
         
   #     def handle(rack_env)
@@ -160,19 +149,16 @@ module Merb
       # action&lt;Symbol&gt;:: The action to dispatch.
       # request&lt;Merb::Request&gt;::
       #   The Merb::Request object that was created in #handle
-      # response&lt;IO&gt;:: The response object passed in from Mongrel
       # status&lt;Integer&gt;:: The status code to respond with.
       #
       # ==== Returns
-      # Array[Merb::Controller, Symbol]::
-      #   An array containing the Merb::Controller and the action that was
-      #   dispatched to.
-      def dispatch_action(klass, request, route, status=200)
+      # Merb::Controller::
+      #   The Merb::Controller that was dispatched to.
+      def dispatch_action(klass, action, request, status=200)
         # build controller
         controller = klass.new(request, status)
-        controller.route = route
         if use_mutex
-          @@mutex.synchronize { controller._dispatch(request.params[:action]) }
+          @@mutex.synchronize { controller._dispatch(action) }
         else
           controller._dispatch(request.params[:action])
         end
@@ -184,54 +170,40 @@ module Merb
       #
       # You can handle exceptions by implementing actions for specific
       # exceptions such as not_found or for entire classes of exceptions
-      # such as client_error
-      #
-      # If it is not available then just render a simple text error.
+      # such as client_error. You can also implement handlers for 
+      # exceptions outside the Merb exception hierarchy (e.g.
+      # StandardError is caught in standard_error).
       #
       # ==== Parameters
       # request&lt;Merb::Request&gt;:: 
       #   The request object associated with the failed request.
-      # response&lt;IO&gt;::
-      #   The response object to put the response into.
       # exception&lt;Object&gt;::
       #   The exception object that was created when trying to dispatch the
       #   original controller.
       #
       # ==== Returns
-      # Array[Merb::Controller, String]::
-      #   An array containing the Merb::Controller and the name of the exception
-      #   that triggrered #dispatch_exception. For instance, a NotFound exception
-      #   will be &quot;not_found&quot;.
-      def dispatch_exception(request, exception, route)
+      # Exceptions::
+      #   The Merb::Controller that was dispatched to. 
+      def dispatch_exception(exception, request)
         Merb.logger.error(Merb.exception(exception))
-        exception_klass = exception.class
-        exceptions = [exception]
-        request.exception_details = {
-          :params =&gt; request.params ? request.params.dup : {},
-          :session =&gt; request.session || {},
-          :cookies =&gt; request.cookies || {},
-        }
-
+        request.exceptions = [exception]
+        
         begin
-          e = exceptions.first
-          klass = Object.const_defined?(&quot;Exceptions&quot;) ? Exceptions : Controller
-          klass.send(:include, Merb::ExceptionsHelper)
-          request.exception_details[:exceptions] = exceptions
+          e = request.exceptions.first
           
           if action_name = e.action_name
-            request.params[:action] = action_name
-            dispatch_action(klass, request, route, e.class.status)
+            dispatch_action(Exceptions, action_name, request, e.class.status)
           else
-            dispatch_default_exception(klass, request, exceptions)
+            dispatch_default_exception(request, e.class.status)
           end          
         rescue Object =&gt; dispatch_issue
           if e.same?(dispatch_issue)
-            dispatch_default_exception(klass, request, exceptions)
+            dispatch_default_exception(request, e.class.status)
           else
             Merb.logger.error(&quot;Dispatching #{e.class} raised another error.&quot;)
             Merb.logger.error(Merb.exception(dispatch_issue))
             
-            exceptions.unshift dispatch_issue
+            request.exceptions.unshift dispatch_issue
             retry
           end
         end
@@ -241,32 +213,16 @@ module Merb
       # will end up here for processing
       #
       # ==== Parameters
-      # klass&lt;Merb::Controller&gt;:: 
-      #   The class of the controller to use for exception dispatch.
       # request&lt;Merb::Request&gt;::
       #   The Merb request that produced the original error.
-      # response&lt;IO&gt;::
-      #   The response object that the response will be put into.
-      # e&lt;Exception&gt;::
-      #   The exception that caused #dispatch_exception to be called.
+      # status&lt;Integer&gt;::
+      #   The status code to return with the Exception.
       #
       # ==== Returns
-      # Array[Merb::Controller, String]::
-      #   An array containing the Merb::Controller that was dispatched to and the
-      #   error's name. For instance, a NotFound error's name is &quot;not_found&quot;.
-      def dispatch_default_exception(klass, request, exceptions)
-        e = exceptions.first
-        controller = klass.new(request, e.class.status)
-        if e.is_a? Redirection
-          controller.headers.merge!('Location' =&gt; e.message)
-          controller.body =
-            &quot;&lt;html&gt;&lt;body&gt;You are being &lt;a href=\&quot;#{e.message}\&quot;&gt;redirected&lt;/a&gt;.&lt;/body&gt;&lt;/html&gt;&quot;
-        else
-          controller.instance_variable_set(&quot;@exceptions&quot;, exceptions)
-          controller.body = controller.send(
-            Merb::Template.template_for(DEFAULT_ERROR_TEMPLATE))
-        end
-        controller
+      # Merb::Dispatcher::DefaultException::
+      #   The DefaultException that was dispatched to.
+      def dispatch_default_exception(request, status)
+        Merb::Dispatcher::DefaultException.new(request, status)._dispatch
       end
 
       # Set up a faux controller to do redirection from the router 
@@ -274,7 +230,10 @@ module Merb
       # ==== Parameters
       # request&lt;Merb::Request&gt;::
       #   The Merb::Request object that was created in #handle
-      # route&lt;Merb::Router::Route&gt;:: Matched route object
+      # status&lt;Integer&gt;::
+      #   The status code to return with the controller
+      # url&lt;String&gt;::
+      #   The URL to return
       #
       # ==== Example
       # r.match(&quot;/my/old/crusty/url&quot;).redirect(&quot;http://example.com/index.html&quot;)
@@ -282,9 +241,8 @@ module Merb
       # ==== Returns
       # Merb::Controller::
       #   Merb::Controller set with redirect headers and a 301/302 status
-      def redirect(request, route)
-        status, url  = route.redirect_details
-
+      def redirect(request)
+        status, url = request.redirect_status, request.redirect_url
         controller = Merb::Controller.new(request, status)
       
         Merb.logger.info(&quot;Dispatcher redirecting to: #{url} (#{status})&quot;)</diff>
      <filename>lib/merb-core/dispatch/dispatcher.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ module Merb
   
   class Request
     # def env def session def route_params
-    attr_accessor :env, :session, :exception_details
+    attr_accessor :env, :session, :exceptions, :route
     attr_reader :route_params
     
     # by setting these to false, auto-parsing is disabled; this way you can
@@ -90,9 +90,21 @@ module Merb
       class_eval &quot;def #{m}?() method == :#{m} end&quot;
     end
     
-    def route_params=(params)
-      @route_params = params
-      @params.merge! params
+    def find_route
+      @route, @route_params = Merb::Router.route_for(self)
+      @params.merge! @route_params
+    end
+    
+    def redirect_status
+      route.redirect_status
+    end
+    
+    def redirect_url
+      route.redirect_url
+    end
+    
+    def redirects?
+      route.redirects?
     end
     
     private</diff>
      <filename>lib/merb-core/dispatch/request.rb</filename>
    </modified>
    <modified>
      <diff>@@ -113,12 +113,25 @@ module Merb
         end
       end
 
+      # ==== Returns
+      # Boolean::
+      #   Does the router specify a redirect?
       def redirects?
         behavior.redirects?
       end
       
-      def redirect_details
-        [behavior.redirect_status, behavior.redirect_url]
+      # ==== Returns
+      # Integer::
+      #   The status code to use if the route redirects
+      def redirect_status
+        behavior.redirect_status
+      end
+      
+      # ==== Returns
+      # String::
+      #   The URL to redirect to if the route redirects
+      def redirect_url
+        behavior.redirect_url
       end
       
       # ==== Returns</diff>
      <filename>lib/merb-core/dispatch/router/route.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,13 +4,13 @@ module Merb
       
       def call(env) 
         begin
-          controller = ::Merb::Dispatcher.handle(env)
+          controller = ::Merb::Dispatcher.handle(Merb::Request.new(env))
         rescue Object =&gt; e
           return [500, {&quot;Content-Type&quot;=&gt;&quot;text/html&quot;}, e.message + &quot;&lt;br/&gt;&quot; + e.backtrace.join(&quot;&lt;br/&gt;&quot;)]
         end
         Merb.logger.info &quot;\n\n&quot;
         Merb.logger.flush
-        [controller.status, controller.headers, controller.body]
+        controller.rack_response
       end
       
     end</diff>
      <filename>lib/merb-core/rack/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -165,13 +165,13 @@ module Merb::Test::Rspec::ControllerMatchers
     
     def matches?(target)
       @target = target
-      @target.request.exception_details &amp;&amp;
-        @target.request.exception_details[:exceptions].first.is_a?(@expected)
+      @target.request.exceptions &amp;&amp;
+        @target.request.exceptions.first.is_a?(@expected)
     end
     
     def failure_message
       &quot;expected #{@target} to be a #{@expected} error, but it was &quot; &lt;&lt; 
-        @target.request.exception_details[:exceptions].first.inspect
+        @target.request.exceptions.first.inspect
     end
     
     def negative_failure_message</diff>
      <filename>lib/merb-core/test/matchers/controller_matchers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,8 +21,9 @@ describe &quot;Kernel#caller&quot; do
   end
 
   it &quot;should be able to get caller lines&quot; do
-    __caller_lines__(__caller_info__[0], __caller_info__[1], 4).length.should == 9
-    __caller_lines__(__caller_info__[0], __caller_info__[1], 4).should be_kind_of(Array)
+    i = 0
+    __caller_lines__(__caller_info__[0], __caller_info__[1], 4) { i += 1 }
+    i.should == 9
   end
 end
 </diff>
      <filename>spec/private/core_ext/kernel_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,3 @@
-
-
 class Exceptions &lt; Application
 
   attr_reader :handler </diff>
      <filename>spec/private/dispatch/fixture/app/controllers/exceptions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,3 @@
-
-
 class Foo &lt; Application
 
   def index</diff>
      <filename>spec/private/dispatch/fixture/app/controllers/foo.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,13 @@
+$START_OPTIONS = {:merb_root =&gt; File.join(File.dirname(__FILE__), &quot;fixture&quot;)}
 require File.join(File.dirname(__FILE__), &quot;spec_helper&quot;)
 require 'rack/mock'
 require 'stringio'
-Merb.start :environment =&gt; 'test', 
-           :merb_root =&gt; File.dirname(__FILE__) / 'fixture'
 
 describe Merb::Dispatcher, &quot;route params&quot; do
   before(:each) do
     env = Rack::MockRequest.env_for(&quot;/foo/bar/54&quot;)
     env['REQUEST_URI'] = &quot;/foo/bar/54&quot;  # MockRequest doesn't set this
-    @controller = Merb::Dispatcher.handle(env)
+    @controller = Merb::Dispatcher.handle(Merb::Request.new(env))
   end
 
   it &quot;should properly set the route params&quot; do</diff>
      <filename>spec/private/dispatch/route_params_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,14 @@ describe Merb::Dispatcher do
     Merb.logger
   end
 
+  def dispatch(url)
+    Merb::Dispatcher.handle(request_for(url))
+  end
+
+  def request_for(url)
+    Merb::Request.new(Rack::MockRequest.env_for(url))
+  end
+
   before(:each) do
     Merb::Config[:exception_details] = true
   end
@@ -22,16 +30,16 @@ describe Merb::Dispatcher do
       Merb::Router.prepare do |r|
         r.default_routes
       end
-      @env = Rack::MockRequest.env_for(&quot;/dispatch_to/index&quot;)
+      @url = &quot;/dispatch_to/index&quot;
     end
   
     it &quot;dispatches to the right controller and action&quot; do
-      controller = Merb::Dispatcher.handle(@env)
+      controller = dispatch(@url)
       controller.body.should == &quot;Dispatched&quot;
     end
     
     it &quot;sets the Request#params to include the route params&quot; do
-      controller = Merb::Dispatcher.handle(@env)
+      controller = dispatch(@url)
       controller.request.params.should == 
         {&quot;controller&quot; =&gt; &quot;dispatch_to&quot;, &quot;action&quot; =&gt; &quot;index&quot;, 
          &quot;id&quot; =&gt; nil, &quot;format&quot; =&gt; nil}
@@ -39,31 +47,31 @@ describe Merb::Dispatcher do
     
     it &quot;provides the time for start of request handling via Logger#info&quot; do
       with_level(:info) do
-        Merb::Dispatcher.handle(@env)
+        dispatch(@url)
       end.should include_log(&quot;Started request handling&quot;)
       
       with_level(:warn) do
-        Merb::Dispatcher.handle(@env)
+        dispatch(@url)
       end.should_not include_log(&quot;Started request handling&quot;)
     end
     
     it &quot;provides the routed params via Logger#debug&quot; do
       with_level(:debug) do
-        Merb::Dispatcher.handle(@env)
+        dispatch(@url)
       end.should include_log(&quot;Routed to:&quot;)
       
       with_level(:info) do
-        Merb::Dispatcher.handle(@env)
+        dispatch(@url)
       end.should_not include_log(&quot;Routed to:&quot;)
     end
     
     it &quot;provides the benchmarks via Logger#info&quot; do
       with_level(:info) do
-        Merb::Dispatcher.handle(@env)
+        dispatch(@url)
       end.should include_log(&quot;:after_filters_time&quot;)
       
       with_level(:warn) do
-        Merb::Dispatcher.handle(@env)
+        dispatch(@url)
       end.should_not include_log(&quot;:after_filters_time&quot;)
     end
   end
@@ -74,8 +82,8 @@ describe Merb::Dispatcher do
         r.match(&quot;/redirect/to/foo&quot;).redirect(&quot;/foo&quot;)
         r.default_routes
       end
-      @env = Rack::MockRequest.env_for(&quot;/redirect/to/foo&quot;)
-      @controller = Merb::Dispatcher.handle(@env)
+      @url = &quot;/redirect/to/foo&quot;
+      @controller = dispatch(@url)
     end
     
     it &quot;redirects&quot; do
@@ -84,11 +92,11 @@ describe Merb::Dispatcher do
     
     it &quot;reports that it is redirecting via Logger#info&quot; do
       with_level(:info) do
-        Merb::Dispatcher.handle(@env)
+        dispatch(@url)
       end.should include_log(&quot;Dispatcher redirecting to: /foo&quot;)
       
       with_level(:warn) do
-        Merb::Dispatcher.handle(@env)
+        dispatch(@url)
       end.should_not include_log(&quot;Dispatcher redirecting to: /foo&quot;)
     end
     
@@ -106,8 +114,8 @@ describe Merb::Dispatcher do
       Merb::Router.prepare do |r|
         r.default_routes
       end
-      @env = Rack::MockRequest.env_for(&quot;/not_a_controller/index&quot;)
-      @controller = Merb::Dispatcher.handle(@env)
+      @url = &quot;/not_a_controller/index&quot;
+      @controller = dispatch(@url)
     end
     
     describe &quot;with exception details showing&quot; do
@@ -144,8 +152,8 @@ describe Merb::Dispatcher do
         Merb::Router.prepare do |r|
           r.default_routes
         end
-        @env = Rack::MockRequest.env_for(&quot;/raise_gone/index&quot;)
-        @controller = Merb::Dispatcher.handle(@env)
+        @url = &quot;/raise_gone/index&quot;
+        @controller = dispatch(@url)
       end
       
       it &quot;remembers that the Exception is Gone&quot; do
@@ -180,8 +188,8 @@ describe Merb::Dispatcher do
         Merb::Router.prepare do |r|
           r.default_routes
         end
-        @env = Rack::MockRequest.env_for(&quot;/raise_gone/index&quot;)
-        @controller = Merb::Dispatcher.handle(@env)
+        @url = &quot;/raise_gone/index&quot;
+        @controller = dispatch(@url)
       end
       
       it &quot;renders the Exception from the Exceptions controller&quot; do
@@ -217,8 +225,8 @@ describe Merb::Dispatcher do
       Merb::Router.prepare do |r|
         r.default_routes
       end
-      @env = Rack::MockRequest.env_for(&quot;/raise_load_error/index&quot;)
-      @controller = Merb::Dispatcher.handle(@env)
+      @url = &quot;/raise_load_error/index&quot;
+      @controller = dispatch(@url)
     end
     
     it &quot;knows that the error is a LoadError&quot; do
@@ -253,8 +261,8 @@ describe Merb::Dispatcher do
       Merb::Router.prepare do |r|
         r.default_routes
       end
-      @env = Rack::MockRequest.env_for(&quot;/raise_load_error/index&quot;)
-      @controller = Merb::Dispatcher.handle(@env)
+      @url = &quot;/raise_load_error/index&quot;
+      @controller = dispatch(@url)
     end
     
     it &quot;knows that the error is a StandardError&quot; do
@@ -294,8 +302,8 @@ describe Merb::Dispatcher do
       Merb::Router.prepare do |r|
         r.default_routes
       end
-      @env = Rack::MockRequest.env_for(&quot;/page/not/found&quot;)
-      @controller = Merb::Dispatcher.handle(@env)
+      @url = &quot;/page/not/found&quot;
+      @controller = dispatch(@url)
     end
     
     it &quot;knows that the error is a NotFound&quot; do
@@ -331,8 +339,8 @@ describe Merb::Dispatcher do
       Merb::Router.prepare do |r|
         r.default_routes
       end
-      @env = Rack::MockRequest.env_for(&quot;/raise_load_error/index&quot;)
-      @controller = Merb::Dispatcher.handle(@env)
+      @url = &quot;/raise_load_error/index&quot;
+      @controller = dispatch(@url)
     end
     
     it &quot;knows that the error is a NotFound&quot; do
@@ -371,8 +379,8 @@ describe Merb::Dispatcher do
       Merb::Router.prepare do |r|
         r.default_routes
       end
-      @env = Rack::MockRequest.env_for(&quot;/raise_load_error/index&quot;)
-      @controller = Merb::Dispatcher.handle(@env)
+      @url = &quot;/raise_load_error/index&quot;
+      @controller = dispatch(@url)
       @body = @controller.body
     end
     </diff>
      <filename>spec/public/controller/dispatcher_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
+$START_OPTIONS = {:merb_root =&gt; File.join(File.dirname(__FILE__), &quot;directory&quot;)}
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot;)
-Merb.start :environment =&gt; 'test',
-           :merb_root =&gt; File.dirname(__FILE__) / &quot;directory&quot;
 
 describe &quot;The default Merb directory structure&quot; do
 </diff>
      <filename>spec/public/directory_structure/directory_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,9 @@ require &quot;rubygems&quot;
 require &quot;spec&quot;
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;lib&quot;, &quot;merb-core&quot;)
 
-Merb.start :environment =&gt; 'test', :adapter =&gt; 'runner'
+default_options = {:environment =&gt; 'test', :adapter =&gt; 'runner'}
+options = default_options.merge($START_OPTIONS || {})
+Merb.start options
 
 # -- Global custom matchers --
 </diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/merb-core/dispatch/exceptions.html.erb</filename>
    </removed>
    <removed>
      <filename>spec/private/dispatch/dispatch_spec.rb</filename>
    </removed>
    <removed>
      <filename>spec/private/rack/application_spec.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>4ca5195c6663b0f0060a70643580d358859b42ff</id>
    </parent>
    <parent>
      <id>063c4caa2f098d221490418607cd43eab5cce4f3</id>
    </parent>
  </parents>
  <author>
    <name>Michael S. Klishin</name>
    <email>michael@novemberain.com</email>
  </author>
  <url>http://github.com/wycats/merb-core/commit/8c7398640ba4cafff011a6abd0d5e7655ccc5cec</url>
  <id>8c7398640ba4cafff011a6abd0d5e7655ccc5cec</id>
  <committed-date>2008-08-08T18:14:19-07:00</committed-date>
  <authored-date>2008-08-08T18:14:19-07:00</authored-date>
  <message>Resolve conflict.</message>
  <tree>d742a6ccbc2149cf8bfb459408fd1448c7a0e320</tree>
  <committer>
    <name>Michael S. Klishin</name>
    <email>michael@novemberain.com</email>
  </committer>
</commit>
