Skip to content

Commit

Permalink
Tweak this spec to run all encodings and skip dummies.
Browse files Browse the repository at this point in the history
This makes the test run and pass the same as in MRI.
  • Loading branch information
headius committed Mar 13, 2015
1 parent 912e77d commit 1dbeb43
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions spec/regression/GH-1675_casecmp_on_UTF16LE_encoded_string_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 1dbeb43

Please sign in to comment.