Skip to content
Permalink
Browse files
Merge pull request #3582 from rubinius/add_string_new_encoding_specs
add failing spec for String.new with optional encoding argument
  • Loading branch information
tak1n committed Jan 21, 2016
2 parents 9cf58de + 57d8550 commit 2337179e23a4fce4283f4713b30e45b332be5733
Showing with 7 additions and 0 deletions.
  1. +6 −0 spec/ruby/core/string/new_spec.rb
  2. +1 −0 spec/tags/ruby/core/string/new_tags.txt
@@ -7,6 +7,12 @@
str.should be_an_instance_of(String)
end

it "accepts an encoding argument" do
str = String.new("\xA4\xA2", encoding: 'euc-jp')

str.encoding.should == Encoding::EUC_JP
end

it "returns a fully-formed String" do
str = String.new
str.size.should == 0
@@ -0,0 +1 @@
fails:String.new accepts an encoding argument

0 comments on commit 2337179

Please sign in to comment.