Skip to content
Permalink
Browse files
add failing spec for String.new with optional encoding argument
  • Loading branch information
tak1n committed Jan 21, 2016
1 parent 9cf58de commit 57d85505811f300fd8127c71d98e808670cd85de
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 57d8550

Please sign in to comment.