Sha256: 92a3bf5d9998c3ff70fa142cf4ad885d5bd8a12d0469922e0dd693c8409c7882

Contents?: true

Size: 1.15 KB

Versions: 20

Compression:

Stored size: 1.15 KB

Contents

require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])

describe SC::Target, 'lproj_for' do

  include SC::SpecHelpers
  
  before do
    @project = fixture_project 'languages'
    @long_names = @project.target_for :long_names
    @short_names = @project.target_for :short_names    
  end
    

  it "should return the long name of a language if installed" do
    SC::Target::SHORT_LANGUAGE_MAP.each do |short_name, long_name|
      @long_names.lproj_for(short_name.to_sym).should eql("#{long_name}.lproj")
    end
  end
  
  it "should return the short name of a language if installed" do
    SC::Target::SHORT_LANGUAGE_MAP.each do |short_name, long_name|
      @short_names.lproj_for(short_name.to_sym).should eql("#{short_name}.lproj")
    end
  end
  
  it "should return the language name if installed + no explicit mapping" do
    @short_names.lproj_for('en-GB').should eql('en-GB.lproj')
  end
  
  it "should return nil for a non-existant language" do
    @short_names.lproj_for('imaginary').should be_nil
  end
  
  it "should return long language name if no mapping is known" do
    @long_names.lproj_for(:unknown).should eql('unknown.lproj')
  end
  
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090407205609 spec/lib/models/target/lproj_for_spec.rb
sproutit-sproutcore-1.0.0.20090408130025 spec/lib/models/target/lproj_for_spec.rb
sproutit-sproutcore-1.0.0.20090416161445 spec/lib/models/target/lproj_for_spec.rb
sproutit-sproutcore-1.0.20090721145236 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1046 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1043 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1042 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1037 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1035 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1031 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1030 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1029 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1027 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1028 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1026 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1025 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1024 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1009 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1008 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.0.1003 spec/lib/models/target/lproj_for_spec.rb