summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/allocate_spec.rb
blob: 30d5f605947fc0127f13e26c71eeea02145a2576 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require_relative '../../spec_helper'

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.allocate.encoding.should == Encoding::BINARY
  end
end