Sha256: 8260bdb72a3d6f9592682551fe02551f402c106f91f33be3a3d4561d2087a625
Contents?: true
Size: 711 Bytes
Versions: 6
Compression:
Stored size: 711 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' module Synvert::Core describe Rewriter::RemoveAction do subject { source = "user = User.new params[:user]\nuser.save\nrender\n" send_node = Parser::CurrentRuby.parse(source).children[1] instance = double(current_node: send_node, file_source: source) Rewriter::RemoveAction.new(instance) } it 'gets begin_pos' do expect(subject.begin_pos).to eq "user = User.new params[:user]\n".length end it 'gets end_pos' do expect(subject.end_pos).to eq "user = User.new params[:user]\nuser.save\n".length end it 'gets rewritten_code' do expect(subject.rewritten_code).to eq '' end end end
Version data entries
6 entries across 6 versions & 1 rubygems