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.54.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.53.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.52.1 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.52.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.51.1 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.51.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.50.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.49.1 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.49.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.48.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.47.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.46.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.45.2 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.45.1 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.45.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.44.1 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.44.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.42.1 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.42.0 spec/synvert/core/rewriter/action/remove_action_spec.rb
synvert-core-0.41.2 spec/synvert/core/rewriter/action/remove_action_spec.rb