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..9048815c5d
--- /dev/null
+++ b/spec/ruby/core/string/allocate_spec.rb
@@ -0,0 +1,19 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+describe "String.allocate" do
+ it "returns an instance of String" do
+ str = String.allocate
+ str.should be_an_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.new.encoding.should == Encoding::BINARY
+ end
+end