Sha256: 7f28d1b3fa277b57d9911f95953de1a9d2d036837d35efc233e29ab0ef8a5688
Contents?: true
Size: 916 Bytes
Versions: 33
Compression:
Stored size: 916 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' module Synvert::Core describe Rewriter::GotoScope do let(:instance) { rewriter = Rewriter.new('foo', 'bar') Rewriter::Instance.new(rewriter, 'file pattern') } let(:source) { <<~EOS } Factory.define :user do |user| end EOS let(:node) { Parser::CurrentRuby.parse(source) } before do Rewriter::Instance.reset instance.current_node = node end describe '#process' do it 'call block with child node' do run = false type_in_scope = nil scope = Rewriter::GotoScope.new instance, :caller, :receiver do run = true type_in_scope = node.type end scope.process expect(run).to be_truthy expect(type_in_scope).to eq :const expect(instance.current_node.type).to eq :block end end end end
Version data entries
33 entries across 33 versions & 1 rubygems