Sha256: 2e299c3dc45e6f4797483610c33731b58f3b20abae516a9fe020ec546dbf33ca

Contents?: true

Size: 767 Bytes

Versions: 39

Compression:

Stored size: 767 Bytes

Contents

#!/usr/bin/env rspec
require 'spec_helper'

describe "the digest function", :uses_checksums => true do
  before :all do
    Puppet::Parser::Functions.autoloader.loadall
  end

  before :each do
    n = Puppet::Node.new('unnamed')
    c = Puppet::Parser::Compiler.new(n)
    @scope = Puppet::Parser::Scope.new(c)
  end

  it "should exist" do
    Puppet::Parser::Functions.function("digest").should == "function_digest"
  end

  with_digest_algorithms do
    it "should use the proper digest function" do
      result = @scope.function_digest([plaintext])
      result.should(eql( checksum ))
    end

    it "should only accept one parameter" do
      expect do
        @scope.function_digest(['foo', 'bar'])
      end.to raise_error(ArgumentError)
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
puppet-3.8.7 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.7-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.7-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.6 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.6-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.6-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.5 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.5-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.5-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.4 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.4-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.4-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.3 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.3-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.3-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.2 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.2-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.2-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.1 spec/unit/parser/functions/digest_spec.rb
puppet-3.8.1-x86-mingw32 spec/unit/parser/functions/digest_spec.rb