Skip to content

Commit

Permalink
Modify spec for #1675 to skip dummy encodings.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 3, 2015
1 parent 25fd16f commit 9aa2238
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions spec/regression/GH-1675_casecmp_on_UTF16LE_encoded_string_spec.rb
Expand Up @@ -2,17 +2,13 @@
if RUBY_VERSION > '1.9'
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
Encoding.list.each do |enc|
next if enc.dummy?

# 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
# using "UTF-16LE", "UTF-8", "Shift_JIS", and other available encodings
a = 'ABC'.encode(enc)
b = 'ABC'.encode(enc)
b.casecmp(a).should be_true
end
end
end
Expand Down

0 comments on commit 9aa2238

Please sign in to comment.