Sha256: c2b4a5fac9c4f54982aaa2ddce524a80155e205da62798673570c2e306157dd9
Contents?: true
Size: 688 Bytes
Versions: 56
Compression:
Stored size: 688 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) 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".length end it 'gets rewritten_code' do expect(subject.rewritten_code).to eq '' end end end
Version data entries
56 entries across 56 versions & 1 rubygems