Sha256: 230773bc1b9eec297507733079cc49317c1740da580b74f30e33d4e6a789e110

Contents?: true

Size: 1.32 KB

Versions: 48

Compression:

Stored size: 1.32 KB

Contents

require 'puppet/pops'

module FactoryRspecHelper
  def literal(x)
    Puppet::Pops::Model::Factory.literal(x)
  end

  def block(*args)
    Puppet::Pops::Model::Factory.block(*args)
  end

  def var(x)
    Puppet::Pops::Model::Factory.var(x)
  end

  def fqn(x)
    Puppet::Pops::Model::Factory.fqn(x)
  end

  def string(*args)
    Puppet::Pops::Model::Factory.string(*args)
  end

  def minus(x)
    Puppet::Pops::Model::Factory.minus(x)
  end

  def IF(test, then_expr, else_expr=nil)
    Puppet::Pops::Model::Factory.IF(test, then_expr, else_expr)
  end

  def UNLESS(test, then_expr, else_expr=nil)
    Puppet::Pops::Model::Factory.UNLESS(test, then_expr, else_expr)
  end

  def CASE(test, *options)
    Puppet::Pops::Model::Factory.CASE(test, *options)
  end

  def WHEN(values, block)
    Puppet::Pops::Model::Factory.WHEN(values, block)
  end

  def method_missing(method, *args, &block)
    if Puppet::Pops::Model::Factory.respond_to? method
      Puppet::Pops::Model::Factory.send(method, *args, &block)
    else
      super
    end
  end

  # i.e. Selector Entry 1 => 'hello'
  def MAP(match, value)
    Puppet::Pops::Model::Factory.MAP(match, value)
  end

  def dump(x)
    Puppet::Pops::Model::ModelTreeDumper.new.dump(x)
  end

  def unindent x
    (x.gsub /^#{x[/\A\s*/]}/, '').chomp
  end
  factory ||= Puppet::Pops::Model::Factory
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
puppet-5.3.7 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.7-x86-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.7-x64-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.7-universal-darwin spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.6 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.6-x86-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.6-x64-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.6-universal-darwin spec/unit/pops/factory_rspec_helper.rb
puppet-5.4.0 spec/unit/pops/factory_rspec_helper.rb
puppet-5.4.0-x86-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-5.4.0-x64-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-5.4.0-universal-darwin spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.5 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.5-x86-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.5-x64-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.5-universal-darwin spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.4 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.4-x86-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.4-x64-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-5.3.4-universal-darwin spec/unit/pops/factory_rspec_helper.rb