Sha256: 8f2007eceb8ae897140c0731a5cfe33ebdfcf0d0a36cf9c3f974dbe7d8c98e46

Contents?: true

Size: 618 Bytes

Versions: 12

Compression:

Stored size: 618 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Rubocop::Cop::VariableInspector do
  include AST::Sexp

  class ExampleInspector
    include Rubocop::Cop::VariableInspector
  end

  subject(:inspector) { ExampleInspector.new }

  describe '#process_node' do
    before do
      inspector.variable_table.push_scope(s(:def))
    end

    context 'when processing lvar node' do
      let(:node) { s(:lvar, :foo) }

      context 'when the variable is not yet declared' do
        it 'does not raise error' do
          expect { inspector.process_node(node) }.not_to raise_error
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
ridecharge-rubocop-0.0.1 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.20.1 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.20.0 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.19.1 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.19.0 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.18.1 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.18.0 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.17.0 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.16.0 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.15.0 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.14.1 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.14.0 spec/rubocop/cop/variable_inspector_spec.rb