Sha256: 457dfc4ed152e156293291c860b6b79df06592f063e0eb8e44dd6b2c6a603f5e

Contents?: true

Size: 696 Bytes

Versions: 44

Compression:

Stored size: 696 Bytes

Contents

#! /usr/bin/env ruby
require 'spec_helper'

describe "the 'fail' parser function" do
  let :scope do
    node     = Puppet::Node.new('localhost')
    compiler = Puppet::Parser::Compiler.new(node)
    scope    = Puppet::Parser::Scope.new(compiler)
    scope.stubs(:environment).returns(nil)
    scope
  end

  it "should exist" do
    expect(Puppet::Parser::Functions.function(:fail)).to eq("function_fail")
  end

  it "should raise a parse error if invoked" do
    expect { scope.function_fail([]) }.to raise_error Puppet::ParseError
  end

  it "should join arguments into a string in the error" do
    expect { scope.function_fail(["hello", "world"]) }.to raise_error(/hello world/)
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
puppet-6.4.0 spec/unit/parser/functions/fail_spec.rb
puppet-6.4.0-x86-mingw32 spec/unit/parser/functions/fail_spec.rb
puppet-6.4.0-x64-mingw32 spec/unit/parser/functions/fail_spec.rb
puppet-6.4.0-universal-darwin spec/unit/parser/functions/fail_spec.rb
puppet-6.0.7 spec/unit/parser/functions/fail_spec.rb
puppet-6.0.7-x86-mingw32 spec/unit/parser/functions/fail_spec.rb
puppet-6.0.7-x64-mingw32 spec/unit/parser/functions/fail_spec.rb
puppet-6.0.7-universal-darwin spec/unit/parser/functions/fail_spec.rb
puppet-6.3.0 spec/unit/parser/functions/fail_spec.rb
puppet-6.3.0-x86-mingw32 spec/unit/parser/functions/fail_spec.rb
puppet-6.3.0-x64-mingw32 spec/unit/parser/functions/fail_spec.rb
puppet-6.3.0-universal-darwin spec/unit/parser/functions/fail_spec.rb
puppet-6.2.0 spec/unit/parser/functions/fail_spec.rb
puppet-6.2.0-x86-mingw32 spec/unit/parser/functions/fail_spec.rb
puppet-6.2.0-x64-mingw32 spec/unit/parser/functions/fail_spec.rb
puppet-6.2.0-universal-darwin spec/unit/parser/functions/fail_spec.rb
puppet-6.0.5 spec/unit/parser/functions/fail_spec.rb
puppet-6.0.5-x86-mingw32 spec/unit/parser/functions/fail_spec.rb
puppet-6.0.5-x64-mingw32 spec/unit/parser/functions/fail_spec.rb
puppet-6.0.5-universal-darwin spec/unit/parser/functions/fail_spec.rb