Sha256: a38af3250424c2704b7843ea9ff4659c7484a64b84fffa7e839a3bde6156adb3

Contents?: true

Size: 1.38 KB

Versions: 150

Compression:

Stored size: 1.38 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 text(x)
    Puppet::Pops::Model::Factory.text(x)
  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

150 entries across 150 versions & 1 rubygems

Version Path
puppet-4.10.12 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.12-x86-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.12-x64-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.12-universal-darwin spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.11 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.11-x86-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.11-x64-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.11-universal-darwin spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.10 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.10-x86-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.10-x64-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.10-universal-darwin spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.9 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.9-x86-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.9-x64-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.9-universal-darwin spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.8 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.8-x86-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.8-x64-mingw32 spec/unit/pops/factory_rspec_helper.rb
puppet-4.10.8-universal-darwin spec/unit/pops/factory_rspec_helper.rb