706f4cbcd04942c2cd07a5a5d869839c22d13731
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / functions / union_spec.rb
1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper'
3
4 describe "the union function" do
5   let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
6
7   it "should exist" do
8     expect(Puppet::Parser::Functions.function("union")).to eq("function_union")
9   end
10
11   it "should raise a ParseError if there are fewer than 2 arguments" do
12     expect { scope.function_union([]) }.to( raise_error(Puppet::ParseError) )
13   end
14
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"]))
18   end
19 end