Sha256: 51bbda4f8241da9f531e0a1f75be5d9eaac5f8e33dbae3eeb96b1385c86a6bcb

Contents?: true

Size: 457 Bytes

Versions: 9

Compression:

Stored size: 457 Bytes

Contents

require 'spec_helper'

describe Unparser::Comments, '#take_all' do

  let(:ast_and_comments) do
    Unparser.parse_with_comments(<<~'RUBY')
      def hi # EOL 1
      end # EOL 2
    RUBY
  end
  let(:ast)      { ast_and_comments[0] }
  let(:comments) { ast_and_comments[1] }
  let(:object)   { described_class.new(comments) }

  it 'should take all comments' do
    expect(object.take_all).to eql(comments)
    expect(object.take_all).to eql([])
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
unparser-0.4.8 spec/unit/unparser/comments/take_all_spec.rb
unparser-0.4.7 spec/unit/unparser/comments/take_all_spec.rb
unparser-0.4.6 spec/unit/unparser/comments/take_all_spec.rb
unparser-0.4.5 spec/unit/unparser/comments/take_all_spec.rb
unparser-0.4.4 spec/unit/unparser/comments/take_all_spec.rb
unparser-0.4.3 spec/unit/unparser/comments/take_all_spec.rb
unparser-0.4.2 spec/unit/unparser/comments/take_all_spec.rb
unparser-0.4.1 spec/unit/unparser/comments/take_all_spec.rb
unparser-0.4.0 spec/unit/unparser/comments/take_all_spec.rb