Sha256: d7a9244b7225474209b9dbea19d524a6d84e82ad7085bd6d041c2cdc057f732e

Contents?: true

Size: 560 Bytes

Versions: 9

Compression:

Stored size: 560 Bytes

Contents

# encoding: utf-8

require 'spec_helper'
require 'astrolabe/sexp'

describe RuboCop::Cop::VariableForce do
  include Astrolabe::Sexp

  subject(:force) { described_class.new([]) }

  describe '#process_node' do
    before do
      force.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 { force.process_node(node) }.not_to raise_error
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/variable_force_spec.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/variable_force_spec.rb
rubocop-0.29.1 spec/rubocop/cop/variable_force_spec.rb
rubocop-0.29.0 spec/rubocop/cop/variable_force_spec.rb
rubocop-0.28.0 spec/rubocop/cop/variable_force_spec.rb
rubocop-0.27.1 spec/rubocop/cop/variable_force_spec.rb
rubocop-0.27.0 spec/rubocop/cop/variable_force_spec.rb
rubocop-0.26.1 spec/rubocop/cop/variable_force_spec.rb
rubocop-0.26.0 spec/rubocop/cop/variable_force_spec.rb