From 1dbeb4342ad8ee4b4576c0c27eac59311e6eda18 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Fri, 13 Mar 2015 11:18:25 -0500 Subject: [PATCH] Tweak this spec to run all encodings and skip dummies. This makes the test run and pass the same as in MRI. --- ...1675_casecmp_on_UTF16LE_encoded_string_spec.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/spec/regression/GH-1675_casecmp_on_UTF16LE_encoded_string_spec.rb b/spec/regression/GH-1675_casecmp_on_UTF16LE_encoded_string_spec.rb index 78eeaac6555..3f2fe9d334b 100644 --- a/spec/regression/GH-1675_casecmp_on_UTF16LE_encoded_string_spec.rb +++ b/spec/regression/GH-1675_casecmp_on_UTF16LE_encoded_string_spec.rb @@ -3,16 +3,11 @@ describe 'String#casecmp' do it 'returns correct value' do Encoding.name_list.each do |enc_name| - if (enc_name != "UTF-7") && (enc_name != "CP65000") - # this condition statement escape the following error: - # Encoding::ConverterNotFoundError: - # code converter not found for UTF-7 - - # using "UTF-16LE", "UTF-8", "Shift_JIS", and other available encodings - a = 'ABC'.encode(enc_name) - b = 'ABC'.encode(enc_name) - b.casecmp(a).should be_true - end + enc = Encoding.find(enc_name) + next if !enc || enc.dummy? + a = 'ABC'.encode(enc) + b = 'ABC'.encode(enc) + b.casecmp(a).should == 0 end end end