Sha256: c6048f67b1d9a985dd5f5304b3aff15abedd84fc843d057b9b7c8da1ae625a42

Contents?: true

Size: 485 Bytes

Versions: 16

Compression:

Stored size: 485 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Unparser::Comments, '#take_all' do

  let(:ast_and_comments) do
    Parser::CurrentRuby.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

16 entries across 16 versions & 1 rubygems

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