aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/string/allocate_spec.rb
blob: 9048815c5da55c991466433fd36e918410f0b15b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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