Sha256: 80fc8567373d703c537c78cc7fe8bcefce6d00c1ce91c599b5aef3921003d4cc

Contents?: true

Size: 1.41 KB

Versions: 15

Compression:

Stored size: 1.41 KB

Contents

require 'spec'
require 'RubyExt/Localization/require'

module RubyExt
	describe "RubyExt::Localization" do
		before :each do
			RubyExt::Localization.default_language = :en
			RubyExt::Localization.language = nil
		end
		
		it "Default Language" do
			ForLocalization::NS::B.new.message.should == "English"
			RubyExt::Localization.default_language = :ru
			ForLocalization::NS::B.new.message.should == "Russian"
		end
		
		it "Not Localized" do
			RubyExt::Localization.default_language = :ru
			ForLocalization::NS::B.new.not_localized.should == "English Not Localized"
		end
		
		it "Language set" do
			ForLocalization::NS::B.new.message.should == "English"
			RubyExt::Localization.language = lambda{:ru}
			ForLocalization::NS::B.new.message.should == "Russian"
		end
		
		it "Language not set" do
			RubyExt::Localization.language = lambda{nil}
			ForLocalization::NS::B.new.message.should == "English"
		end
		
		it "Class Hierarchy" do
			RubyExt::Localization.language = lambda{:ru}
			ForLocalization::NS::B.new.class_hierarchy_message.should == "Class Hierarchy Russian"
		end
		
		it "Namespace Hierarchy" do
			RubyExt::Localization.language = lambda{:ru}
			ForLocalization::NS::B.new.namespace_hierarchy_message.should ==
          "Namespace Hierarchy Russian"
		end
		
		it "Substitution" do
			RubyExt::Localization.language = lambda{:ru}
			ForLocalization::NS::B.new.substitution.should == "Russian 10"
		end
	end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
ruby-ext-0.2.16 old/spec/localization_spec.rb
ruby-ext-0.2.15 old/spec/localization_spec.rb
ruby-ext-0.2.13 old/spec/localization_spec.rb
ruby-ext-0.2.12 old/spec/localization_spec.rb
ruby-ext-0.2.11 old/spec/localization_spec.rb
ruby-ext-0.2.10 old/spec/localization_spec.rb
ruby-ext-0.2.9 old/spec/localization_spec.rb
ruby-ext-0.2.8 old/spec/localization_spec.rb
ruby-ext-0.2.7 old/spec/localization_spec.rb
ruby-ext-0.2.6 old/spec/localization_spec.rb
ruby-ext-0.2.5 old/spec/localization_spec.rb
ruby-ext-0.2.4 old/spec/localization_spec.rb
ruby-ext-0.2.3 old/spec/localization_spec.rb
RubyExt-0.1.1 spec/localization_spec.rb
RubyExt-0.1.2 spec/localization_spec.rb