Sha256: a9c0de3661b57ead0530791720c5157f2f5b4c2d81787fd1162079f54c9f36c0

Contents?: true

Size: 573 Bytes

Versions: 17

Compression:

Stored size: 573 Bytes

Contents

require 'spec_helper'

describe Unparser::Buffer, '#append' do
  subject { object.append(string) }

  let(:object) { described_class.new }
  let(:string) { 'foo' }

  specify do
    expect { subject }.to change { object.content }.from('').to('foo')
  end

  # Yeah duplicate, mutant will be improved ;)
  it 'should prefix with indentation if line is empty' do
    object.append('foo')
    object.nl
    object.indent
    object.append('bar')
    object.append('baz')
    expect(object.content).to eql("foo\n  barbaz")
  end

  it_should_behave_like 'a command method'
end

Version data entries

17 entries across 17 versions & 1 rubygems

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