diff options
Diffstat (limited to 'spec/ruby/core/string/new_spec.rb')
-rw-r--r-- | spec/ruby/core/string/new_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ruby/core/string/new_spec.rb b/spec/ruby/core/string/new_spec.rb index 0a246f6f53..b429ac48d2 100644 --- a/spec/ruby/core/string/new_spec.rb +++ b/spec/ruby/core/string/new_spec.rb @@ -15,6 +15,13 @@ describe "String.new" do end end + ruby_version_is "2.4" do + it "accepts a capacity argument" do + String.new("", capacity: 100_000).should == "" + String.new("abc", capacity: 100_000).should == "abc" + end + end + it "returns a fully-formed String" do str = String.new str.size.should == 0 |