Sha256: b6fd9676269c3197bd79e08f58fd7de0400a1fd68f6ecd40b6bd1065bc6393f6

Contents?: true

Size: 347 Bytes

Versions: 4

Compression:

Stored size: 347 Bytes

Contents

# frozen_string_literal: true

module CompilerTestHelpers
	# @return Array
	def compile(view)
		@compiler = Phlex::Compiler.new(view)
		output = []

		mock(@compiler) do |m|
			m.before(:redefine) { output << _1 }
		end

		@compiler.call

		output.map! do |method|
			Phlex::Compiler::Formatter.format("", SyntaxTree.parse(method))
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
phlex-0.5.3 fixtures/compiler_test_helpers.rb
phlex-0.5.2 fixtures/compiler_test_helpers.rb
phlex-0.5.1 fixtures/compiler_test_helpers.rb
phlex-0.5.0 fixtures/compiler_test_helpers.rb