Sha256: 772a57b688564e774f79d5fd8b336a22a37b1b7235d95569ae4047aba8a01e87

Contents?: true

Size: 601 Bytes

Versions: 6

Compression:

Stored size: 601 Bytes

Contents

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

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

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

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

  it "should return the difference between two arrays" do
    result = scope.function_difference([["a","b","c"],["b","c","d"]])
    expect(result).to(eq(["a"]))
  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/difference_spec.rb
puppet-retrospec-0.12.0 spec/fixtures/modules/stdlib/spec/functions/difference_spec.rb
puppet-retrospec-0.11.0 spec/fixtures/modules/stdlib/spec/functions/difference_spec.rb
puppet-retrospec-0.10.0 spec/fixtures/modules/stdlib/spec/functions/difference_spec.rb
puppet-retrospec-0.9.1 spec/fixtures/modules/stdlib/spec/functions/difference_spec.rb
puppet-retrospec-0.9.0 spec/fixtures/modules/stdlib/spec/functions/difference_spec.rb