Sha256: 5d02953808477c610cda11b70c98d2f18c00d1c99fb848a767a1a22149d8c288
Contents?: true
Size: 709 Bytes
Versions: 41
Compression:
Stored size: 709 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' module Synvert::Core describe Rewriter::ReplaceAction do context 'replace with single line' do subject { source = 'FactoryBot.create(:user)' node = Parser::CurrentRuby.parse(source) instance = double(current_node: node) Rewriter::ReplaceAction.new(instance, :receiver, :dot, :message, with: 'create') } it 'gets begin_pos' do expect(subject.begin_pos).to eq 0 end it 'gets end_pos' do expect(subject.end_pos).to eq 'FactoryBot.create'.length end it 'gets rewritten_code' do expect(subject.rewritten_code).to eq 'create' end end end end
Version data entries
41 entries across 41 versions & 1 rubygems