Skip to content

Commit

Permalink
Add a spec for how the ignore option interacts with errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed Sep 7, 2010
1 parent f79c179 commit 311a35b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/ruby/library/iconv/iconv_spec.rb
Expand Up @@ -121,6 +121,18 @@
end

it_behaves_like :iconv_initialize_exceptions, :iconv, "test"

describe "using the ignore option" do
# This spec exists because some implementions of libiconv return
# an error for this sequence even though they consume all of the
# input and write the proper output. We want to be sure that those
# platforms ignore the error and give us the data back.
#
it "causes unknown bytes to be ignored" do
str = "f\303\266\303\266 bar" # this is foo bar, with umlate o's
Iconv.iconv('ascii//ignore', 'utf-8', str)[0].should == "f bar"
end
end
end

describe "The 'utf-8' encoder" do
Expand Down

0 comments on commit 311a35b

Please sign in to comment.