Sha256: 10287d30aa98f6b244d7b165d674698508da49c119ec51da6378d27611ef00f4

Contents?: true

Size: 592 Bytes

Versions: 16

Compression:

Stored size: 592 Bytes

Contents

# encoding: utf-8

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

16 entries across 16 versions & 1 rubygems

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