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