Sha256: 32ee15b3aa263ab00983eb282870b5c69f3c8122c351597fdfa2de4c3f0f02bd

Contents?: true

Size: 553 Bytes

Versions: 420

Compression:

Stored size: 553 Bytes

Contents

require 'spec_helper'
require 'puppet/pops'
require_relative 'parser_rspec_helper'

describe 'egrammar parsing function definitions' do
  include ParserRspecHelper

  context 'without return type' do
    it 'function foo() { 1 }' do
      expect(dump(parse('function foo() { 1 }'))).to eq("(function foo (block\n  1\n))")
    end
  end

  context 'with return type' do
    it 'function foo() >> Integer { 1 }' do
      expect(dump(parse('function foo() >> Integer { 1 }'))).to eq("(function foo (return_type Integer) (block\n  1\n))")
    end
  end
end

Version data entries

420 entries across 420 versions & 1 rubygems

Version Path
puppet-8.3.0 spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.3.0-x86-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.3.0-x64-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.3.0-universal-darwin spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.4.0 spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.4.0-x86-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.4.0-x64-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.4.0-universal-darwin spec/unit/pops/parser/parse_functions_spec.rb
puppet-7.28.0 spec/unit/pops/parser/parse_functions_spec.rb
puppet-7.28.0-x86-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-7.28.0-x64-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-7.28.0-universal-darwin spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.3.1 spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.3.1-x86-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.3.1-x64-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-8.3.1-universal-darwin spec/unit/pops/parser/parse_functions_spec.rb
puppet-7.27.0 spec/unit/pops/parser/parse_functions_spec.rb
puppet-7.27.0-x86-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-7.27.0-x64-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-7.27.0-universal-darwin spec/unit/pops/parser/parse_functions_spec.rb