Sha256: 5939d0ebe26a0c0789a23031ffc7bb0b4523adca1758778c205e5fe7ad00f4ca
Contents?: true
Size: 674 Bytes
Versions: 27
Compression:
Stored size: 674 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' module Synvert::Core describe Rewriter::WrapAction do subject { source = "class Bar\nend" node = Parser::CurrentRuby.parse(source) instance = double(current_node: node) Rewriter::WrapAction.new(instance, with: 'module Foo').process } it 'gets begin_pos' do expect(subject.begin_pos).to eq 0 end it 'gets end_pos' do expect(subject.end_pos).to eq "class Bar\nend".length end it 'gets rewritten_code' do expect(subject.rewritten_code).to eq <<~EOS.strip module Foo class Bar end end EOS end end end
Version data entries
27 entries across 27 versions & 1 rubygems