Sha256: 3c97833235be272a97b5316214a70fb539a1ce4f256fa7e1297a8aea6c33831b

Contents?: true

Size: 977 Bytes

Versions: 13

Compression:

Stored size: 977 Bytes

Contents

require 'spec_helper'

describe Rails3::Plugin::Extender do
  describe '#extend_rails' do
    it "should extend i18n" do
      Rails3::Plugin::Extender.new do
        extend_rails :i18n do
          with MyAddition

          before :initialize do
            MyOtherAddition.say 'before localized!'
          end      

          before :configuration do
            MyOtherAddition.configured = 'was configured!'      
          end

          before :eager_load do
            puts "before eager load!"
          end
      
          after :initialize do
            MyAddition.say 'localized!'
          end      
        end
      end
    
      # Initialize the rails application
      Minimal::Application.initialize!        
      I18n.methods.grep(/zzz/).should_not be_empty

      MyAddition.heard.should == 'localized!'
      MyOtherAddition.heard.should == 'before localized!'
      MyOtherAddition.configured.should == 'was configured!'      
    end    
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
r3_plugin_toolbox-0.4.3 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.4.2 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.4.1 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.4.0 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.3.15 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.3.14 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.3.13 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.3.12 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.3.11 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.3.10 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.3.8 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.3.7 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb
r3_plugin_toolbox-0.3.6 spec/r3_plugin_toolbox/extender/extender_i18n_spec.rb