Sha256: 672d56331a5a3bbe0c31134f441af0fb3a019ac283663182a0456495eca05e9d

Contents?: true

Size: 1.5 KB

Versions: 11

Compression:

Stored size: 1.5 KB

Contents

require File.join( File.dirname(__FILE__), 'test_helper' )
require 'globalize/translation'

class TranslationTest < ActiveSupport::TestCase
  include Globalize
   
  def setup
    @translation = Translation::Static.new 'foo', :locale => :'en-US'
  end

  test "responds to fallback?" do
    assert @translation.respond_to?( :fallback? )
  end

  test "returns true when :locale and :requested_locale are not equal" do
    @translation.requested_locale = :'de-DE'
    assert @translation.fallback?
  end
  
  test "returns false when :locale and :requested_locale are equal" do
    @translation.requested_locale = :'en-US'
    assert !@translation.fallback?
  end
    
  test "has the attribute :locale" do
    assert @translation.respond_to?( :locale )
  end
  
  test "has the attribute :requested_locale" do
    assert @translation.respond_to?( :requested_locale )
  end
  
  test "has the attribute :options" do
    assert @translation.respond_to?( :options )
  end
  
  test "has the attribute :plural_key" do
    assert @translation.respond_to?( :plural_key )
  end
  
  test "has the attribute :original" do
    assert @translation.respond_to?( :original )    
  end
  
  test "Translation::Attribute has the attribute :locale" do
    translation = Translation::Attribute.new 'foo'
    assert translation.respond_to?( :locale )
  end
  
  test "Translation::Attribute has the attribute :requested_locale" do
    translation = Translation::Attribute.new 'foo'
    assert translation.respond_to?( :requested_locale )
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
kriss-gettext_i18n-0.2.0 vendor/globalize2/test/translation_test.rb
kriss-gettext_i18n-0.2.1 vendor/globalize2/test/translation_test.rb
kriss-gettext_i18n-0.2.2 vendor/globalize2/test/translation_test.rb
kriss-gettext_i18n-0.2.3 vendor/globalize2/test/translation_test.rb
simonmenke-globalize2-0.0.1 test/translation_test.rb
simonmenke-globalize2-0.0.4 test/translation_test.rb
simonmenke-globalize2-0.0.5 test/translation_test.rb
simonmenke-globalize2-0.0.6 test/translation_test.rb
simonmenke-simonmenke-globalize2-0.0.2 test/translation_test.rb
simonmenke-globalize2-0.0.7 test/translation_test.rb
globalize2-0.1.0 test/translation_test.rb