summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/shared/each_line_without_block.rb
blob: 8e08b0390c9521a4863390bde78c2bd79fca345c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
describe :string_each_line_without_block, shared: true do
  describe "when no block is given" do
    it "returns an enumerator" do
      enum = "hello world".send(@method, ' ')
      enum.should be_an_instance_of(Enumerator)
      enum.to_a.should == ["hello ", "world"]
    end

    describe "returned Enumerator" do
      describe "size" do
        it "should return nil" do
          "hello world".send(@method, ' ').size.should == nil
        end
      end
    end
  end
end