Sha256: 812caee23665fe3f0421172e203bab2940066f87639aa0bc4c80ab76f14b9349

Contents?: true

Size: 702 Bytes

Versions: 196

Compression:

Stored size: 702 Bytes

Contents

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

describe "egrammar parsing of 'application'" do
  include ParserRspecHelper

  it "an empty body" do
    expect(dump(parse("application foo { }"))).to eq("(application foo () ())")
  end

  it "an empty body" do
    prog = <<-EPROG
application foo {
  db { one:
    password => 'secret'
  }
}
EPROG
    expect(dump(parse(prog))).to eq( [
"(application foo () (block",
"  (resource db",
"    (one",
"      (password => 'secret')))", "))" ].join("\n"))
  end

  it "accepts parameters" do
    s = "application foo($p1 = 'yo', $p2) { }"
    expect(dump(parse(s))).to eq("(application foo ((= p1 'yo') p2) ())")
  end
end

Version data entries

196 entries across 196 versions & 1 rubygems

Version Path
puppet-6.25.0 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.25.0-x86-mingw32 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.25.0-x64-mingw32 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.25.0-universal-darwin spec/unit/pops/parser/parse_application_spec.rb
puppet-6.24.0 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.24.0-x86-mingw32 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.24.0-x64-mingw32 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.24.0-universal-darwin spec/unit/pops/parser/parse_application_spec.rb
puppet-6.23.0 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.23.0-x86-mingw32 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.23.0-x64-mingw32 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.23.0-universal-darwin spec/unit/pops/parser/parse_application_spec.rb
puppet-6.22.1 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.22.1-x86-mingw32 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.22.1-x64-mingw32 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.22.1-universal-darwin spec/unit/pops/parser/parse_application_spec.rb
puppet-6.21.1 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.21.1-x86-mingw32 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.21.1-x64-mingw32 spec/unit/pops/parser/parse_application_spec.rb
puppet-6.21.1-universal-darwin spec/unit/pops/parser/parse_application_spec.rb