Skip to content

Commit

Permalink
Merge pull request #3582 from rubinius/add_string_new_encoding_specs
Browse files Browse the repository at this point in the history
add failing spec for String.new with optional encoding argument
  • Loading branch information
tak1n committed Jan 21, 2016
2 parents 9cf58de + 57d8550 commit 2337179
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/ruby/core/string/new_spec.rb
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions spec/tags/ruby/core/string/new_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fails:String.new accepts an encoding argument

0 comments on commit 2337179

Please sign in to comment.