Sha256: 1cb322183a7cb32660fcd1906aeabd4d1640f95be93a06a81323b91d5a45decd

Contents?: true

Size: 642 Bytes

Versions: 11

Compression:

Stored size: 642 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe RuboCop::Token do
  describe '.from_parser_token' do
    subject(:token) { described_class.from_parser_token(parser_token) }
    let(:parser_token) { [type, [text, range]] }
    let(:type) { :kDEF }
    let(:text) { 'def' }
    let(:range) { double('range') }

    it "sets parser token's type to rubocop token's type" do
      expect(token.type).to eq(type)
    end

    it "sets parser token's text to rubocop token's text" do
      expect(token.text).to eq(text)
    end

    it "sets parser token's range to rubocop token's pos" do
      expect(token.pos).to eq(range)
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/token_spec.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/token_spec.rb
rubocop-0.28.0 spec/rubocop/token_spec.rb
rubocop-0.27.1 spec/rubocop/token_spec.rb
rubocop-0.27.0 spec/rubocop/token_spec.rb
rubocop-0.26.1 spec/rubocop/token_spec.rb
rubocop-0.26.0 spec/rubocop/token_spec.rb
rubocop-0.25.0 spec/rubocop/token_spec.rb
rubocop-0.24.1 spec/rubocop/token_spec.rb
rubocop-0.24.0 spec/rubocop/token_spec.rb
rubocop-0.23.0 spec/rubocop/token_spec.rb