<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,46 +1,46 @@
 require File.join(File.dirname(__FILE__), &quot;spec_helper&quot;)
 
 describe &quot;A route derived from the blocks of #match&quot; do
-  
+
   it &quot;should inherit the :controller option.&quot; do
     Merb::Router.prepare do |r|
-      r.match('/alpha', :controller=&gt;'Alphas') do |alpha| 
+      r.match('/alpha', :controller=&gt;'Alphas') do |alpha|
         alpha.match('').to(:action=&gt;'normal')
       end
     end
     route_to('/alpha').should have_route(:controller=&gt;'Alphas',:action=&gt;'normal')
   end
-  
+
   it &quot;should inherit the :action option.&quot; do
     Merb::Router.prepare do |r|
-      r.match('/alpha', :action=&gt;'wierd') do |alpha| 
+      r.match('/alpha', :action=&gt;'wierd') do |alpha|
         alpha.match('').to(:controller=&gt;'Alphas')
       end
     end
     route_to('/alpha').should have_route(:controller=&gt;'Alphas',:action=&gt;'wierd')
   end
-  
+
   it &quot;should inherit the default :action of 'index'&quot; do
     Merb::Router.prepare do |r|
-      r.match('/alpha', :controller=&gt;'Alphas') do |alpha| 
+      r.match('/alpha', :controller=&gt;'Alphas') do |alpha|
         alpha.match('').to({})
       end
     end
     route_to('/alpha').should have_route(:controller=&gt;'Alphas',:action=&gt;'index')
   end
-  
+
   it &quot;should make use of the :params option&quot; do
     Merb::Router.prepare do |r|
-      r.match('/alpha', :controller=&gt;'Alphas', :params =&gt;{:key=&gt;'value'}) do |alpha| 
+      r.match('/alpha', :controller=&gt;'Alphas', :params =&gt;{:key=&gt;'value'}) do |alpha|
         alpha.match('').to(:action=&gt;'normal',:key2=&gt;'value2')
       end
     end
     route_to('/alpha').should have_route(:controller=&gt;'Alphas',:key=&gt;'value',:action=&gt;'normal',:key2=&gt;'value2')
   end
-  
+
   it &quot;should inherit the parameters through many levels&quot; do
     Merb::Router.prepare do |r|
-      r.match('/alpha', :controller=&gt;'Alphas') do |alpha| 
+      r.match('/alpha', :controller=&gt;'Alphas') do |alpha|
         alpha.match('/beta', :action=&gt;'normal') do |beta|
           beta.match('/:id').to(:id=&gt;':id')
         end
@@ -48,5 +48,50 @@ describe &quot;A route derived from the blocks of #match&quot; do
     end
     route_to('/alpha/beta/gamma').should have_route(:controller=&gt;'Alphas',:action=&gt;'normal', :id=&gt;'gamma')
   end
-  
-end
\ No newline at end of file
+
+  it &quot;allows wrapping of nested routes all having shared argument&quot; do
+    Merb::Router.prepare do |r|
+      r.match('/:language') do |i18n|
+        i18n.match!('/:controller/:action')
+      end
+    end
+    route_to('/fr/hotels/search').should have_route(:controller =&gt; 'hotels', :action =&gt; &quot;search&quot;, :language =&gt; &quot;fr&quot;)
+  end
+
+  it &quot;allows wrapping of nested routes all having shared argument&quot; do
+    Merb::Router.prepare do |r|
+      r.match(/\/?(.*)?/).to(:language =&gt; &quot;[1]&quot;) do |l|
+        l.match(&quot;/guides/:action/:id&quot;).to(:controller =&gt; &quot;tour_guides&quot;)
+      end
+    end
+
+    route_to('/en/guides/search/london').should have_route(:controller =&gt; 'tour_guides', :action =&gt; &quot;search&quot;, :language =&gt; &quot;en&quot;, :id =&gt; &quot;london&quot;)
+  end
+
+  it &quot;allows wrapping of nested routes all having shared OPTIONAL argument&quot; do
+    Merb::Router.prepare do |r|
+      r.match(/\/?(.*)?/).to(:language =&gt; &quot;[1]&quot;) do |l|
+        l.match(&quot;/guides/:action/:id&quot;).to(:controller =&gt; &quot;tour_guides&quot;)
+      end
+    end
+
+    route_to('/guides/search/london').should have_route(:controller =&gt; 'tour_guides', :action =&gt; &quot;search&quot;, :id =&gt; &quot;london&quot;)
+  end
+
+  it &quot;allows wrapping of nested routes all having shared argument with PREDEFINED VALUES&quot; do
+    Merb::Router.prepare do |r|
+      r.match(/\/?(en|es|fr|be|nl)?/).to(:language =&gt; &quot;[1]&quot;) do |l|
+        l.match(&quot;/guides/:action/:id&quot;).to(:controller =&gt; &quot;tour_guides&quot;)
+      end
+    end
+
+    route_to('/nl/guides/search/denboss').should have_route(:controller =&gt; 'tour_guides', :action =&gt; &quot;search&quot;, :id =&gt; &quot;denboss&quot;, :language =&gt; &quot;nl&quot;)
+    route_to('/es/guides/search/barcelona').should have_route(:controller =&gt; 'tour_guides', :action =&gt; &quot;search&quot;, :id =&gt; &quot;barcelona&quot;, :language =&gt; &quot;es&quot;)
+    route_to('/fr/guides/search/lille').should have_route(:controller =&gt; 'tour_guides', :action =&gt; &quot;search&quot;, :id =&gt; &quot;lille&quot;, :language =&gt; &quot;fr&quot;)
+    route_to('/en/guides/search/london').should have_route(:controller =&gt; 'tour_guides', :action =&gt; &quot;search&quot;, :id =&gt; &quot;london&quot;, :language =&gt; &quot;en&quot;)
+    route_to('/be/guides/search/brussels').should have_route(:controller =&gt; 'tour_guides', :action =&gt; &quot;search&quot;, :id =&gt; &quot;brussels&quot;, :language =&gt; &quot;be&quot;)
+
+    route_to('/guides/search/brussels').should have_route(:controller =&gt; 'tour_guides', :action =&gt; &quot;search&quot;, :id =&gt; &quot;brussels&quot;)
+    route_to('/se/guides/search/stokholm').should have_route(:controller =&gt; 'tour_guides', :action =&gt; &quot;search&quot;, :id =&gt; &quot;stokholm&quot;, :language =&gt; nil)
+  end
+end</diff>
      <filename>spec/public/router/nested_matches_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>28d86fa31c6409e406d96c6b0642e8d3e27644b6</id>
    </parent>
  </parents>
  <author>
    <name>Michael S. Klishin</name>
    <email>michael@novemberain.com</email>
  </author>
  <url>http://github.com/wycats/merb-core/commit/c53276953f5ad83c328c0efebadfd599ef6f91a4</url>
  <id>c53276953f5ad83c328c0efebadfd599ef6f91a4</id>
  <committed-date>2008-05-16T16:39:12-07:00</committed-date>
  <authored-date>2008-05-16T16:39:12-07:00</authored-date>
  <message>Add a bunch of pretty advanced spec examples for nested matches in routes.</message>
  <tree>3cbafce3c990e42ee0911555985377c544b6e876</tree>
  <committer>
    <name>Michael S. Klishin</name>
    <email>michael@novemberain.com</email>
  </committer>
</commit>
