summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/allocate_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/allocate_spec.rb')
-rw-r--r--spec/ruby/core/string/allocate_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/ruby/core/string/allocate_spec.rb b/spec/ruby/core/string/allocate_spec.rb
new file mode 100644
index 0000000000..00dadaf076
--- /dev/null
+++ b/spec/ruby/core/string/allocate_spec.rb
@@ -0,0 +1,19 @@
+require_relative '../../spec_helper'
+
+describe "String.allocate" do
+ it "returns an instance of String" do
+ str = String.allocate
+ str.should.instance_of?(String)
+ end
+
+ it "returns a fully-formed String" do
+ str = String.allocate
+ str.size.should == 0
+ str << "more"
+ str.should == "more"
+ end
+
+ it "returns a binary String" do
+ String.allocate.encoding.should == Encoding::BINARY
+ end
+end