Sha256: f19de250ec9218882eb057e5ce958cbc27a3854b8c97faa523d8859577372dc7

Contents?: true

Size: 1.09 KB

Versions: 65

Compression:

Stored size: 1.09 KB

Contents

require "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

65 entries across 65 versions & 1 rubygems

Version Path
sproutcore-1.11.0 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.11.0.rc3 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.11.0.rc2 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.11.0.rc1 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.10.3.1 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.10.2 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.10.1 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.10.0 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.10.0.rc.3 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.10.0.rc.2 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.10.0.rc.1 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.9.2 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.9.1 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.9.0 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.8.2.1 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.8.1 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.8.0 spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.7.1.beta-java spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.7.1.beta spec/lib/models/target/lproj_for_spec.rb
sproutcore-1.6.0.1-java spec/lib/models/target/lproj_for_spec.rb