Sha256: bd5db88f5193ceb1dbb15be9d629f9c148c0ca643bbb7759343e31a11bf10d36

Contents?: true

Size: 622 Bytes

Versions: 7

Compression:

Stored size: 622 Bytes

Contents

#! /usr/bin/env ruby -S rspec

require 'spec_helper'

describe "the max function" do
  let(:scope) { PuppetlabsSpec::PuppetInternals.scope }

  it "should exist" do
    Puppet::Parser::Functions.function("max").should == "function_max"
  end

  it "should raise a ParseError if there is less than 1 arguments" do
    lambda { scope.function_max([]) }.should( raise_error(Puppet::ParseError))
  end

  it "should be able to compare strings" do
    scope.function_max(["albatross","dog","horse"]).should(eq("horse"))
  end

  it "should be able to compare numbers" do
    scope.function_max([6,8,4]).should(eq(8))
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
service_kiosk-0.5.6 provision/modules/stdlib/spec/unit/puppet/parser/functions/max_spec.rb
service_kiosk-0.5.5 provision/modules/stdlib/spec/unit/puppet/parser/functions/max_spec.rb
service_kiosk-0.5.4 provision/modules/stdlib/spec/unit/puppet/parser/functions/max_spec.rb
service_kiosk-0.5.3 provision/modules/stdlib/spec/unit/puppet/parser/functions/max_spec.rb
service_kiosk-0.5.2 provision/modules/stdlib/spec/unit/puppet/parser/functions/max_spec.rb
service_kiosk-0.5.1 provision/modules/stdlib/spec/unit/puppet/parser/functions/max_spec.rb
service_kiosk-0.5.0 provision/modules/stdlib/spec/unit/puppet/parser/functions/max_spec.rb