diff options
author | Varac <varac@leap.se> | 2017-10-13 14:22:08 +0200 |
---|---|---|
committer | Varac <varac@leap.se> | 2017-10-13 14:22:08 +0200 |
commit | f7779ce2eacaca51790d4e8d7756442b02612d30 (patch) | |
tree | 56871c123e1c964fc26e36bb86831a4a3511bd4f /spec/functions/dig44_spec.rb | |
parent | 066c08f8362d53f0f30897cb8710d11260c726ea (diff) | |
parent | 2339ea8db67ac7ef02d707c2a6011ae50f5d82b5 (diff) |
Diffstat (limited to 'spec/functions/dig44_spec.rb')
-rw-r--r-- | spec/functions/dig44_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/functions/dig44_spec.rb b/spec/functions/dig44_spec.rb index 4f7408d..a7b8a3d 100644 --- a/spec/functions/dig44_spec.rb +++ b/spec/functions/dig44_spec.rb @@ -25,6 +25,18 @@ describe 'dig44' do } end + let(:utf8_data) do + { + 'ẵ' => { + 'в' => [ + '©', + 'ĝ', + 'に', + ] + } + } + end + context 'single values' do it 'should exist' do is_expected.not_to be_nil @@ -100,6 +112,20 @@ describe 'dig44' do it 'should return "nil" if value is not found and no default value is provided' do is_expected.to run.with_params(data, %w(a 1)).and_return(nil) end + end + + context 'Internationalization (i18N) values' do + + it 'should be able to return a unicode character' do + is_expected.to run.with_params(utf8_data, ['ẵ', 'в', 0]).and_return('©') + end + it 'should be able to return a utf8 character' do + is_expected.to run.with_params(utf8_data, ['ẵ', 'в', 1]).and_return('ĝ') + end + + it 'should be able to return a double byte character' do + is_expected.to run.with_params(utf8_data, ['ẵ', 'в', 2]).and_return('に') + end end end |