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

Version Path
synvert-core-0.41.1 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.41.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.40.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.39.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.38.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.36.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.35.1 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.35.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.34.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.33.1 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.33.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.32.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.31.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.30.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.29.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.28.1 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.28.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.27.4 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.27.3 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.27.2 spec/synvert/core/rewriter/action/remove_action_spec.rb