Sha256: c4dedf8dc1634a9c54b43aaa40edf4b6765e9d908a8a670542d2c1680efafd2d

Contents?: true

Size: 524 Bytes

Versions: 8

Compression:

Stored size: 524 Bytes

Contents

require 'spec_helper'

describe Unparser::Emitter::SourceMap, '.emit' do
  let(:object)  { described_class           }
  let(:subject) { object.emit(node, buffer) }
  let(:buffer)  { Unparser::Buffer.new      }

  let(:node) do
    mock('Node', 
      :type => :foo,
      :location => mock('SourceMap', 
        :expression => mock('SourceRange', :source => 'foo')
      )
    )
  end

  it 'should append source map expression to buffer' do
    expect { subject }.to change { buffer.content }.from('').to('foo')
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
unparser-0.0.8 spec/unit/unparser/emitter/source_map/class_methods/emit_spec.rb
unparser-0.0.7 spec/unit/unparser/emitter/source_map/class_methods/emit_spec.rb
unparser-0.0.6 spec/unit/unparser/emitter/source_map/class_methods/emit_spec.rb
unparser-0.0.5 spec/unit/unparser/emitter/source_map/class_methods/emit_spec.rb
unparser-0.0.4 spec/unit/unparser/emitter/source_map/class_methods/emit_spec.rb
unparser-0.0.3 spec/unit/unparser/emitter/source_map/class_methods/emit_spec.rb
unparser-0.0.2 spec/unit/unparser/emitter/source_map/class_methods/emit_spec.rb
unparser-0.0.1 spec/unit/unparser/emitter/source_map/class_methods/emit_spec.rb