Sha256: 109e3a7d7429946d81307c5e646672f0f9436bf7c3b64e8687352fab2cc6a523

Contents?: true

Size: 1.07 KB

Versions: 15

Compression:

Stored size: 1.07 KB

Contents

require File.join(File.dirname(__FILE__), '..', 'spec_helper')

describe WebTranslateIt::Configuration do
  before(:each) do
    WebTranslateIt::Configuration.const_set("RAILS_ROOT", File.dirname(__FILE__) + '/../examples')
  end
  
  describe "#initialize" do
    it "should fetch and not blow up" do
      lambda{ WebTranslateIt::Configuration.new }.should_not raise_error
    end
        
    it "should load the content of the YAML file" do
      config_hash = {
        "api_key"        => "abcd",
        "ignore_locales" => "en_GB",
        "files"          => ["config/locales/file1_[locale].yml", "config/locales/file2_[locale].yml"]
      }
      YAML.should_receive(:load_file).and_return(config_hash)
      WebTranslateIt::Configuration.new
    end
    
    it "should assign the API key, autofetch, files and master_locale" do
      configuration = WebTranslateIt::Configuration.new
      configuration.api_key.should == 'abcd'
      configuration.files.first.should be_a(WebTranslateIt::TranslationFile)
      configuration.ignore_locales.should == ['en_GB']
    end
  end
  
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
wti_gettext_i18n_rails-1.0.3 spec/web_translate_it/configuration_spec.rb
wti_gettext_i18n_rails-1.0.2 spec/web_translate_it/configuration_spec.rb
wti_gettext_i18n_rails-1.0.1 spec/web_translate_it/configuration_spec.rb
wti_gettext_i18n_rails-1.0.0 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.5.2 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.5.1 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.5.0 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.4.7 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.4.6 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.4.5 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.4.4 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.4.3 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.4.2 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.4.1 spec/web_translate_it/configuration_spec.rb
web_translate_it-1.4.0 spec/web_translate_it/configuration_spec.rb