diff options
author | Alejandro Rodríguez <alejorro70@gmail.com> | 2017-12-26 21:53:31 +0300 |
---|---|---|
committer | Alejandro Rodríguez <alejorro70@gmail.com> | 2017-12-28 18:32:33 +0300 |
commit | 11247ac97c2e15d188878eb946cbc0817f705749 (patch) | |
tree | eecd51e54a2c1b8d92799d34b3854efe9489292c /spec/lib/gitlab/encoding_helper_spec.rb | |
parent | 46be07d2c1da93cffd59fb03036e357c04ff6f3b (diff) |
Move encoding methods to the more general EncodingHelper
Diffstat (limited to 'spec/lib/gitlab/encoding_helper_spec.rb')
-rw-r--r-- | spec/lib/gitlab/encoding_helper_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/encoding_helper_spec.rb b/spec/lib/gitlab/encoding_helper_spec.rb index f6e5c55240f..87ec2698fc1 100644 --- a/spec/lib/gitlab/encoding_helper_spec.rb +++ b/spec/lib/gitlab/encoding_helper_spec.rb @@ -145,4 +145,18 @@ describe Gitlab::EncodingHelper do end end end + + describe 'encode_binary' do + [ + [nil, ""], + ["", ""], + [" ", " "], + %w(a1 a1), + ["编码", "\xE7\xBC\x96\xE7\xA0\x81".b] + ].each do |input, result| + it "encodes #{input.inspect} to #{result.inspect}" do + expect(ext_class.encode_binary(input)).to eq(result) + end + end + end end |