Sha256: 40b36b416f85238b609adaee5e49ace25b0591e115d863738ee198725fa91e30

Contents?: true

Size: 553 Bytes

Versions: 124

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

124 entries across 124 versions & 1 rubygems

Version Path
puppet-5.3.7 spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.3.7-x86-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.3.7-x64-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.3.7-universal-darwin spec/unit/pops/parser/parse_functions_spec.rb
puppet-4.10.12 spec/unit/pops/parser/parse_functions_spec.rb
puppet-4.10.12-x86-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-4.10.12-x64-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-4.10.12-universal-darwin spec/unit/pops/parser/parse_functions_spec.rb
puppet-4.10.11 spec/unit/pops/parser/parse_functions_spec.rb
puppet-4.10.11-x86-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-4.10.11-x64-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-4.10.11-universal-darwin spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.3.6 spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.3.6-x86-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.3.6-x64-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.3.6-universal-darwin spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.4.0 spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.4.0-x86-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.4.0-x64-mingw32 spec/unit/pops/parser/parse_functions_spec.rb
puppet-5.4.0-universal-darwin spec/unit/pops/parser/parse_functions_spec.rb