<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -19,11 +19,11 @@ module Merb
             accept_language.collect! do |lang|
               if lang.any?
                 lang
-              elsif Merb::Global::Locale.supported? lang
+              elsif Merb::Global::Locale.support? lang
                 lang
               else
                 lang = lang.base_locale
-                if not lang.nil? and Merb::Global::Locale.supported? lang
+                if not lang.nil? and Merb::Global::Locale.support? lang
                   lang
                 else
                   nil</diff>
      <filename>lib/merb_global/controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -107,12 +107,13 @@ module Merb
           end
         end
       end
-      def self.supported?(locale)
+
+      def self.support?(locale)
         Merb::Global.config('locales', ['en']).include? locale.to_s
       end
       
       def self.choose(except)
-        (Merb::Global.config('locales', ['en']) - except).first
+        new((Merb::Global.config('locales', ['en']) - except.map{|e| e.to_s}).first)
       end
     end
   end</diff>
      <filename>lib/merb_global/locale.rb</filename>
    </modified>
    <modified>
      <diff>@@ -39,11 +39,7 @@ describe Merb::Controller do
 
   it 'should take the weights into account' do
     de = Merb::Global::Locale.new('de')
-    en = Merb::Global::Locale.new('en')
-    es = Merb::Global::Locale.new('es')
-    Merb::Global::Locale.expects(:support?).with(de).returns(true)
-    Merb::Global::Locale.expects(:support?).with(en).returns(false)
-    Merb::Global::Locale.stubs(:support?).with(es).returns(true)
+    Merb::Global.stubs(:config).with('locales', ['en']).returns(['de', 'es'])
     controller = dispatch_to(TestController, :index) do |controller|
       controller.request.env['HTTP_ACCEPT_LANGUAGE'] =
         'de;q=0.8,en;q=1.0,es;q=0.6'
@@ -61,11 +57,9 @@ describe Merb::Controller do
   end
 
   it 'should choose language if \'*\' given' do
-    en = Merb::Global::Locale.new('en')
     fr = Merb::Global::Locale.new('fr')
-    Merb::Global::Locale.stubs(:support?).returns(true)
-    Merb::Global::Locale.stubs(:support?).with(en).returns(true)
-    Merb::Global::Locale.expects(:choose).with([en]).returns(fr)
+    en = Merb::Global::Locale.new('en')
+    Merb::Global.stubs(:config).with('locales', ['en']).returns(['en','fr'])
     controller = dispatch_to(TestController, :index) do |controller|
       controller.request.env['HTTP_ACCEPT_LANGUAGE'] = '*,en;q=0.7'
     end
@@ -91,14 +85,8 @@ describe Merb::Controller do
   end
 
   it 'should fallback to lang if lang_REGION is not supported' do
-    es_ES = Merb::Global::Locale.new('es-ES')
-    es = Merb::Global::Locale.new('es')
-    pt_BR = Merb::Global::Locale.new('pt-BR')
     pt = Merb::Global::Locale.new('pt')
-    Merb::Global::Locale.expects(:support?).with(es_ES).returns(false)
-    Merb::Global::Locale.expects(:support?).with(es).returns(false)
-    Merb::Global::Locale.expects(:support?).with(pt_BR).returns(false)
-    Merb::Global::Locale.expects(:support?).with(pt).returns(true)
+    Merb::Global.stubs(:config).with('locales', ['en']).returns(['pt'])    
     controller = dispatch_to(TestController, :index) do |controller|
       controller.request.env['HTTP_ACCEPT_LANGUAGE'] = 'es-ES,pt-BR;q=0.7'
     end</diff>
      <filename>spec/controller_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>169ede72eef7b74c53afc7bf0c77d1116ad47c19</id>
    </parent>
  </parents>
  <author>
    <name>Guillaume Maury</name>
    <email>pm@gom-jabbar.org</email>
  </author>
  <url>http://github.com/myabc/merb_global/commit/43e18a403d9a2b34b80bc709bec5bc074a4f2ce6</url>
  <id>43e18a403d9a2b34b80bc709bec5bc074a4f2ce6</id>
  <committed-date>2009-01-29T06:11:07-08:00</committed-date>
  <authored-date>2008-12-13T04:31:23-08:00</authored-date>
  <message>Corrected the bugs from 4ce4cbb63e3e2be9d61b323d4f6a0bd556f3e516
Changed the spec to use mochs a bit less so as to catch bugs.
It's now mocking Merb::Global.config for setting the supported locales (closer to the situation outside of tests...)</message>
  <tree>795cb0cf6fa7550cd04e50507136747be201d3e4</tree>
  <committer>
    <name>Maciej Piechotka</name>
    <email>uzytkownik2@gmail.com</email>
  </committer>
</commit>
