diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-05-15 16:57:24 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-05-15 17:00:37 +0100 |
commit | cfb656ca40cbe4e34a5df795bb8514e427c8c708 (patch) | |
tree | 1ba9ed9a619595215e9375e69cce910f3b9f9fe3 /spec/lib/languages_spec.rb | |
parent | da706b6c05ee7d0be15b59cf0fdec7f6d3ed58ec (diff) |
Allow locale specific language names and add one for Hong Kong Chinese.
Diffstat (limited to 'spec/lib/languages_spec.rb')
-rw-r--r-- | spec/lib/languages_spec.rb | 22 |
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 |