Sha256: 02d87284ed8efbf4f97703345e3449f2aea0e01c7ec3594fb4009f94c727a414

Contents?: true

Size: 682 Bytes

Versions: 304

Compression:

Stored size: 682 Bytes

Contents

require 'spec_helper'

describe "the digest function", :uses_checksums => true do
  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
    expect(Puppet::Parser::Functions.function("digest")).to eq("function_digest")
  end

  with_digest_algorithms do
    it "should use the proper digest function" do
      result = @scope.function_digest([plaintext])
      expect(result).to(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

304 entries across 304 versions & 1 rubygems

Version Path
puppet-8.3.0 spec/unit/parser/functions/digest_spec.rb
puppet-8.3.0-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-8.3.0-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-8.3.0-universal-darwin spec/unit/parser/functions/digest_spec.rb
puppet-8.4.0 spec/unit/parser/functions/digest_spec.rb
puppet-8.4.0-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-8.4.0-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-8.4.0-universal-darwin spec/unit/parser/functions/digest_spec.rb
puppet-7.28.0 spec/unit/parser/functions/digest_spec.rb
puppet-7.28.0-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-7.28.0-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-7.28.0-universal-darwin spec/unit/parser/functions/digest_spec.rb
puppet-8.3.1 spec/unit/parser/functions/digest_spec.rb
puppet-8.3.1-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-8.3.1-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-8.3.1-universal-darwin spec/unit/parser/functions/digest_spec.rb
puppet-7.27.0 spec/unit/parser/functions/digest_spec.rb
puppet-7.27.0-x86-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-7.27.0-x64-mingw32 spec/unit/parser/functions/digest_spec.rb
puppet-7.27.0-universal-darwin spec/unit/parser/functions/digest_spec.rb