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.29.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.28.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.28.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.27.4 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.27.3 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.27.2 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.27.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.27.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.26.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.26.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.25.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.25.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.24.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.23.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.22.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.21.2 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.21.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.21.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.20.1 spec/synvert/core/rewriter/action/insert_after_action_spec.rb
synvert-core-0.20.0 spec/synvert/core/rewriter/action/insert_after_action_spec.rb