Sha256: d3bf003bca0022e6e8b2998b4e19e8adb4d770f53b7822799aa16a24ef2a7765

Contents?: true

Size: 624 Bytes

Versions: 62

Compression:

Stored size: 624 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
  describe Rewriter::InsertAfterAction do
    subject {
      source = '  include Foo'
      node = Parser::CurrentRuby.parse(source)
      instance = double(current_node: node)
      Rewriter::InsertAfterAction.new(instance, 'include Bar')
    }

    it 'gets begin_pos' do
      expect(subject.begin_pos).to eq '  include Foo'.length
    end

    it 'gets end_pos' do
      expect(subject.end_pos).to eq '  include Foo'.length
    end

    it 'gets rewritten_code' do
      expect(subject.rewritten_code).to eq "\n  include Bar"
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
synvert-core-0.56.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.56.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.55.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.54.3 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.54.2 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.54.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.54.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.53.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.52.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.52.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.51.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.51.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.50.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.49.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.49.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.48.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.47.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.46.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.45.2 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.45.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb