Sha256: 637d13db15f52e03a54011f3fc9108fbdc033605a14353a35fbb9e0c06bfad85

Contents?: true

Size: 519 Bytes

Versions: 16

Compression:

Stored size: 519 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Unparser::Buffer, '#fresh_line?' do
  let(:object) { described_class.new }

  it 'should return true while buffer is empty' do
    expect(object.fresh_line?).to eql(true)
  end

  it 'should return false after content has been appended' do
    object.append('foo')
    expect(object.fresh_line?).to eql(false)
  end

  it 'should return true after a nl has been appended' do
    object.append('foo')
    object.nl
    expect(object.fresh_line?).to eql(true)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
unparser-0.2.4 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.2.3 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.2.2 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.2.1 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.2.0 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.16 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.15 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.14 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.13 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.12 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.11 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.10 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.9 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.8 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.7 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.6 spec/unit/unparser/buffer/fresh_line_spec.rb