Sha256: 7d455258940707855a5f953910d9bb9b7d3b51b9dd2bed3ca3ae7c084804881b

Contents?: true

Size: 708 Bytes

Versions: 2

Compression:

Stored size: 708 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

      class ExampleInspector
        include 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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubocop-0.13.1 spec/rubocop/cop/variable_inspector_spec.rb
rubocop-0.13.0 spec/rubocop/cop/variable_inspector_spec.rb