1 #! /usr/bin/env ruby -S rspec
4 describe "the union function" do
5 let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
8 expect(Puppet::Parser::Functions.function("union")).to eq("function_union")
11 it "should raise a ParseError if there are fewer than 2 arguments" do
12 expect { scope.function_union([]) }.to( raise_error(Puppet::ParseError) )
15 it "should join two arrays together" do
16 result = scope.function_union([["a","b","c"],["b","c","d"]])
17 expect(result).to(eq(["a","b","c","d"]))