aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/languages_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/languages_spec.rb')
-rw-r--r--spec/lib/languages_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/languages_spec.rb b/spec/lib/languages_spec.rb
new file mode 100644
index 000000000..38f611087
--- /dev/null
+++ b/spec/lib/languages_spec.rb
@@ -0,0 +1,22 @@
+# -*- encoding : utf-8 -*-
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe LanguageNames do
+
+ describe :get_language_name do
+
+ it 'should return the name assigned to the language' do
+ LanguageNames.get_language_name('en').should == 'English'
+ end
+
+ it 'should return the name assigned to the language when there is no specific location' do
+ LanguageNames.get_language_name('pt_BR').should == 'Português'
+ end
+
+ it 'should return the name assigned to the language/location combination' do
+ LanguageNames.get_language_name('zh_HK').should == '中文(香港)'
+ end
+
+ end
+
+end