<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,4 @@
 doc
-spec/db/*
+spec/spec/db/*
 vendor
-NOTES
-test.rb
+NOTES
\ No newline at end of file</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 module I18n
   class &lt;&lt; self
     def chain_backends(*args)
-      backend = Globalize::Backend::Chain.new(*args)
+      self.backend = Globalize::Backend::Chain.new(*args)
     end
   end
 end
@@ -59,7 +59,7 @@ module Globalize
         default = options.delete(:default)
         result = backends.inject({}) do |namespace, backend|
           begin
-            translation = backend.translate(locale, key, options) 
+            translation = backend.translate(locale.to_sym, key, options) 
             if namespace_lookup?(translation, options)
               namespace.merge! translation
             elsif translation</diff>
      <filename>lib/globalize/backend/chain.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,11 +15,11 @@ describe I18n, '.chain_backends' do
     lambda{ I18n.chain_backends }.should_not raise_error
     I18n.backend.should be_instance_of(Globalize::Backend::Chain)
   end
-  
+
   it &quot;passes all given arguments to the chained backends #initialize method&quot; do
     Globalize::Backend::Chain.should_receive(:new).with(:spec, :simple)
     I18n.chain_backends :spec, :simple
-  end 
+  end
 end
 
 describe Globalize::Backend::Chain, '#initialize' do
@@ -32,22 +32,22 @@ describe Globalize::Backend::Chain, '#add' do
   before :each do
     I18n.backend = Globalize::Backend::Chain.new
   end
-  
+
   it &quot;accepts an instance of a backend&quot; do
     lambda{ I18n.backend.add Globalize::Backend::Spec.new }.should_not raise_error
     I18n.backend.send(:backends).first.should be_instance_of(Globalize::Backend::Spec)
   end
-  
+
   it &quot;accepts a class and instantiates the backend&quot; do
     lambda{ I18n.backend.add Globalize::Backend::Spec }.should_not raise_error
     I18n.backend.send(:backends).first.should be_instance_of(Globalize::Backend::Spec)
   end
-  
+
   it &quot;accepts a symbol, constantizes it as a backend class and instantiates the backend&quot; do
     lambda{ I18n.backend.add :spec }.should_not raise_error
     I18n.backend.send(:backends).first.should be_instance_of(Globalize::Backend::Spec)
   end
-  
+
   it &quot;accepts any number of backend instances, classes or symbols&quot; do
     lambda{ I18n.backend.add Globalize::Backend::Spec.new, Globalize::Backend::Spec, :spec }.should_not raise_error
     I18n.backend.send(:backends).map{|backend| backend.class }.should == [Globalize::Backend::Spec, Globalize::Backend::Spec, Globalize::Backend::Spec]
@@ -74,61 +74,61 @@ end
 
 describe Globalize::Backend::Chain, '#translate' do
   before :each do
-    I18n.backend = Globalize::Backend::Chain.new    
+    I18n.backend = Globalize::Backend::Chain.new
     @first_backend = I18n::Backend::Simple.new
-    @last_backend = I18n::Backend::Simple.new    
+    @last_backend = I18n::Backend::Simple.new
     I18n.backend.add @first_backend
     I18n.backend.add @last_backend
   end
-  
+
   it &quot;delegates #translate to all backends in the order they were added&quot; do
-    @first_backend.should_receive(:translate).with('en-US', :foo, {})
-    @last_backend.should_receive(:translate).with('en-US', :foo, {})
+    @first_backend.should_receive(:translate).with(:'en-US', :foo, {})
+    @last_backend.should_receive(:translate).with(:'en-US', :foo, {})
     I18n.translate :foo
   end
-  
+
   it &quot;returns the result from #translate from the first backend if it's not nil&quot; do
     @first_backend.store_translations :'en-US', {:foo =&gt; 'foo from first backend'}
     @last_backend.store_translations :'en-US', {:foo =&gt; 'foo from last backend'}
     result = I18n.translate :foo
     result.should == 'foo from first backend'
   end
-  
+
   it &quot;returns the result from #translate from the second backend if the first one returned nil&quot; do
     @first_backend.store_translations :'en-US', {}
     @last_backend.store_translations :'en-US', {:foo =&gt; 'foo from last backend'}
     result = I18n.translate :foo
     result.should == 'foo from last backend'
   end
-  
+
   it &quot;looks up a namespace from all backends and merges them (if a result is a hash and no count option is present)&quot; do
     @first_backend.store_translations :'en-US', {:foo =&gt; {:bar =&gt; 'bar from first backend'}}
     @last_backend.store_translations :'en-US', {:foo =&gt; {:baz =&gt; 'baz from last backend'}}
     result = I18n.translate :foo
     result.should == {:bar =&gt; 'bar from first backend', :baz =&gt; 'baz from last backend'}
   end
-  
+
   it &quot;raises a MissingTranslationData exception if no translation was found&quot; do
     lambda{ I18n.translate :not_here, :raise =&gt; true }.should raise_error(I18n::MissingTranslationData)
   end
-  
+
   it &quot;raises an InvalidLocale exception if the locale is nil&quot; do
     lambda{ Globalize::Backend::Chain.new.translate nil, :foo }.should raise_error(I18n::InvalidLocale)
   end
-  
+
   it &quot;bulk translates a number of keys from different backends&quot; do
     @first_backend.store_translations :'en-US', {:foo =&gt; 'foo from first backend'}
     @last_backend.store_translations :'en-US', {:bar =&gt; 'bar from last backend'}
     result = I18n.translate [:foo, :bar]
     result.should == ['foo from first backend', 'bar from last backend']
   end
-  
+
   describe 'when called with a default option' do
     it &quot;still calls #translate on all the backends&quot; do
       @last_backend.should_receive :translate
       I18n.translate :not_here, :default =&gt; 'default'
     end
-    
+
     it &quot;returns a given default string when no backend returns a translation&quot; do
       result = I18n.translate :not_here, :default =&gt; 'default'
       result.should == 'default'
@@ -144,26 +144,26 @@ end
 
 describe Globalize::Backend::Chain, '#localize' do
   before :each do
-    I18n.backend = Globalize::Backend::Chain.new    
+    I18n.backend = Globalize::Backend::Chain.new
     @first_backend = CustomLocalizeBackend.new
-    @last_backend = I18n::Backend::Simple.new    
+    @last_backend = I18n::Backend::Simple.new
     I18n.backend.add @first_backend
     I18n.backend.add @last_backend
     @time = Time.now
   end
-  
+
   it &quot;delegates #localize to all backends in the order they were added&quot; do
-    @first_backend.should_receive(:localize).with('en-US', @time, :default)
-    @last_backend.should_receive(:localize).with('en-US', @time, :default)
+    @first_backend.should_receive(:localize).with(:'en-US', @time, :default)
+    @last_backend.should_receive(:localize).with(:'en-US', @time, :default)
     I18n.localize @time
   end
-  
+
   it &quot;returns the result from #localize from the first backend if it's not nil&quot; do
     @last_backend.should_not_receive :localize
     result = I18n.localize @time, :locale =&gt; 'custom'
     result.should == 'result from custom localize backend'
   end
-  
+
   it &quot;returns the result from #localize from the second backend if the first one returned nil&quot; do
     @last_backend.should_receive(:localize).and_return &quot;value from last backend&quot;
     result = I18n.localize @time
@@ -172,18 +172,18 @@ describe Globalize::Backend::Chain, '#localize' do
 end
 
 describe Globalize::Backend::Chain, '#namespace_lookup?' do
-  before :each do 
+  before :each do
     @backend = Globalize::Backend::Chain.new
   end
-  
+
   it &quot;returns false if the given result is not a Hash&quot; do
     @backend.send(:namespace_lookup?, 'foo', {}).should be_false
   end
-  
+
   it &quot;returns false if a count option is present&quot; do
     @backend.send(:namespace_lookup?, {:foo =&gt; 'foo'}, {:count =&gt; 1}).should be_false
   end
-  
+
   it &quot;returns true if the given result is a Hash AND no count option is present&quot; do
     @backend.send(:namespace_lookup?, {:foo =&gt; 'foo'}, {}).should be_true
   end</diff>
      <filename>spec/backends/chained_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,13 +12,14 @@ require 'spec/spec/models/post'
 
 describe Globalize::Model::ActiveRecord::Translated, 'in the guise of a Post object' do
   include Spec::Matchers::HaveAttribute
-  include Spec::Helpers::ActiveRecord  
+  include Spec::Helpers::ActiveRecord
 
   before do
     I18n.locale = 'en-US'
+    I18n.fallbacks.clear 
     reset_db
   end
-  
+
   it &quot;has post_translations&quot; do
     post = Post.create
     lambda { post.globalize_translations }.should_not raise_error
@@ -26,57 +27,57 @@ describe Globalize::Model::ActiveRecord::Translated, 'in the guise of a Post obj
 
   it &quot;returns the value passed to :subject&quot; do
     post = Post.new
-    (post.subject = 'foo').should == 'foo'    
-  end 
+    (post.subject = 'foo').should == 'foo'
+  end
 
   it &quot;translates subject and content into en-US&quot; do
     post = Post.create :subject =&gt; 'foo', :content =&gt; 'bar'
     post.subject.should == 'foo'
     post.content.should == 'bar'
-    post.save.should == true 
+    post.save.should == true
     post.reload
-    post.subject.should == 'foo' 
+    post.subject.should == 'foo'
     post.content.should == 'bar'
   end
-  
+
   it &quot;finds a German post&quot; do
     post = Post.create :subject =&gt; 'foo', :content =&gt; 'bar'
     I18n.locale = 'de-DE'
     post = Post.first
     post.subject = 'baz'
     post.save
-    Post.first.subject.should == 'baz'    
+    Post.first.subject.should == 'baz'
     I18n.locale = 'en-US'
-    Post.first.subject.should == 'foo'    
+    Post.first.subject.should == 'foo'
   end
-  
+
   it &quot;saves an English post and loads it correctly&quot; do
     Post.first.should == nil
     post = Post.create :subject =&gt; 'foo', :content =&gt; 'bar'
-    post.save.should == true 
+    post.save.should == true
     post = Post.first
-    post.subject.should == 'foo' 
-    post.content.should == 'bar'    
+    post.subject.should == 'foo'
+    post.content.should == 'bar'
   end
-  
+
   it &quot;updates an attribute&quot; do
     post = Post.create :subject =&gt; 'foo', :content =&gt; 'bar'
     post.update_attribute :subject, 'baz'
-    Post.first.subject.should == 'baz'    
+    Post.first.subject.should == 'baz'
   end
-  
+
   it &quot;validates presence of :subject&quot; do
     class Post
       validates_presence_of :subject
     end
-    
+
     post = Post.new
     post.save.should == false
-    
+
     post = Post.new :subject =&gt; 'foo'
     post.save.should == true
   end
-  
+
   it &quot;returns the value for the correct locale, after locale switching&quot; do
     post = Post.create :subject =&gt; 'foo'
     I18n.locale = 'de-DE'
@@ -86,7 +87,7 @@ describe Globalize::Model::ActiveRecord::Translated, 'in the guise of a Post obj
     post = Post.first
     post.subject.should == 'foo'
     I18n.locale = 'de-DE'
-    post.subject.should == 'bar'   
+    post.subject.should == 'bar'
   end
 
   it &quot;returns the value for the correct locale, after locale switching, without saving&quot; do
@@ -96,7 +97,7 @@ describe Globalize::Model::ActiveRecord::Translated, 'in the guise of a Post obj
     I18n.locale = 'en-US'
     post.subject.should == 'foo'
     I18n.locale = 'de-DE'
-    post.subject.should == 'bar'   
+    post.subject.should == 'bar'
   end
 
   it &quot;saves all locales, even after locale switching&quot; do
@@ -110,11 +111,11 @@ describe Globalize::Model::ActiveRecord::Translated, 'in the guise of a Post obj
     post = Post.first
     post.subject.should == 'foo'
     I18n.locale = 'de-DE'
-    post.subject.should == 'bar'   
+    post.subject.should == 'bar'
     I18n.locale = 'he-IL'
-    post.subject.should == 'baz'   
+    post.subject.should == 'baz'
   end
-  
+
   it &quot;resolves a simple fallback&quot; do
     I18n.locale = 'de-DE'
     post = Post.create :subject =&gt; 'foo'
@@ -124,9 +125,9 @@ describe Globalize::Model::ActiveRecord::Translated, 'in the guise of a Post obj
     post.save
     I18n.locale = 'de-DE'
     post.subject.should == 'foo'
-    post.content.should == 'bar'    
+    post.content.should == 'bar'
   end
-  
+
   it &quot;resolves a simple fallback without reloading&quot; do
     I18n.locale = 'de-DE'
     post = Post.new :subject =&gt; 'foo'
@@ -135,11 +136,11 @@ describe Globalize::Model::ActiveRecord::Translated, 'in the guise of a Post obj
     post.content = 'bar'
     I18n.locale = 'de-DE'
     post.subject.should == 'foo'
-    post.content.should == 'bar'    
+    post.content.should == 'bar'
   end
 
   it &quot;resolves a complex fallback without reloading&quot; do
-    I18n.fallbacks.map 'de' =&gt; %w(en he) # fallbacks are now being set globally [Sv]
+    I18n.fallbacks.map 'de' =&gt; %w(en he)
     I18n.locale = 'de'
     post = Post.new
     I18n.locale = 'en'
@@ -149,9 +150,9 @@ describe Globalize::Model::ActiveRecord::Translated, 'in the guise of a Post obj
     post.content = 'bar'
     I18n.locale = 'de'
     post.subject.should == 'foo'
-    post.content.should == 'bar'    
+    post.content.should == 'bar'
   end
-  
+
   it &quot;returns nil if no translations are found&quot; do
     post = Post.new :subject =&gt; 'foo'
     post.subject.should == 'foo'
@@ -175,12 +176,12 @@ describe Globalize::Model::ActiveRecord::Translated, 'in the guise of a Post obj
     blog.posts.first.subject == 'foo'
     blog.posts.last.subject.should be_nil
     I18n.locale = 'de-DE'
-    blog.posts.last.subject.should == 'bar'    
+    blog.posts.last.subject.should == 'bar'
   end
-  
-  # TODO error checking for fields that exist in main table, don't exist in 
+
+  # TODO error checking for fields that exist in main table, don't exist in
   # proxy table, aren't strings or text
-  
+
   # TODO allow finding by translated attributes in conditions?
-  # TODO generate dynamic finders?  
+  # TODO generate dynamic finders?
 end</diff>
      <filename>spec/model/active_record/translated_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>spec/spec/db/.gitignore</filename>
    </removed>
    <removed>
      <filename>spec/spec/db/test.db</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>f19e3ea34878c1536251226bb22f6218340c8f1a</id>
    </parent>
  </parents>
  <author>
    <name>Sven Fuchs</name>
    <email>svenfuchs@artweb-design.de</email>
  </author>
  <url>http://github.com/hchoroomi/globalize2/commit/827d88cc881e738ef62e3decb5f20bc1e99bdfaf</url>
  <id>827d88cc881e738ef62e3decb5f20bc1e99bdfaf</id>
  <committed-date>2008-09-17T01:30:48-07:00</committed-date>
  <authored-date>2008-09-17T01:30:48-07:00</authored-date>
  <message>fix specs when run in reverse order</message>
  <tree>2f9dd94a36381e7cfb16cf203d784c709077a411</tree>
  <committer>
    <name>Sven Fuchs</name>
    <email>svenfuchs@artweb-design.de</email>
  </committer>
</commit>
