Sha256: 0b9a07d95c9b0df357ab847871897a549b817938e92d9d7e3e9262c379487db9

Contents?: true

Size: 612 Bytes

Versions: 6

Compression:

Stored size: 612 Bytes

Contents

#! /usr/bin/env ruby -S rspec
require 'spec_helper'

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

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

  it "should raise a ParseError if there are fewer than 2 arguments" do
    expect { scope.function_intersection([]) }.to( raise_error(Puppet::ParseError) )
  end

  it "should return the intersection of two arrays" do
    result = scope.function_intersection([["a","b","c"],["b","c","d"]])
    expect(result).to(eq(["b","c"]))
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-retrospec-0.12.1 spec/fixtures/modules/stdlib/spec/functions/intersection_spec.rb
puppet-retrospec-0.12.0 spec/fixtures/modules/stdlib/spec/functions/intersection_spec.rb
puppet-retrospec-0.11.0 spec/fixtures/modules/stdlib/spec/functions/intersection_spec.rb
puppet-retrospec-0.10.0 spec/fixtures/modules/stdlib/spec/functions/intersection_spec.rb
puppet-retrospec-0.9.1 spec/fixtures/modules/stdlib/spec/functions/intersection_spec.rb
puppet-retrospec-0.9.0 spec/fixtures/modules/stdlib/spec/functions/intersection_spec.rb