Skip to content

Commit 214cf9e

Browse files
tak1neregon
authored andcommitted
add failing spec for String.new with optional encoding argument
1 parent 48fd956 commit 214cf9e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/string/new_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
str.should be_an_instance_of(String)
88
end
99

10+
it "accepts an encoding argument" do
11+
str = String.new("\xA4\xA2", encoding: 'euc-jp')
12+
13+
str.encoding.should == Encoding::EUC_JP
14+
end
15+
1016
it "returns a fully-formed String" do
1117
str = String.new
1218
str.size.should == 0

0 commit comments

Comments
 (0)