Sha256: 586de21e1fb679253ffbf1a6f9ed5b85a51eaacd3fceaa874c062fe515bd375b

Contents?: true

Size: 500 Bytes

Versions: 17

Compression:

Stored size: 500 Bytes

Contents

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

17 entries across 17 versions & 1 rubygems

Version Path
unparser-0.4.8 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.4.7 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.4.6 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.4.5 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.4.4 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.4.3 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.4.2 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.4.1 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.4.0 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.3.0 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.2.8 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.2.7 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.2.6 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.2.5 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.5 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.4 spec/unit/unparser/buffer/fresh_line_spec.rb
unparser-0.1.3 spec/unit/unparser/buffer/fresh_line_spec.rb