Sha256: 1177581fd5885b0351561b98a06edc3ecb315f5cd65a9cc19958d9cc75708fe8

Contents?: true

Size: 971 Bytes

Versions: 1

Compression:

Stored size: 971 Bytes

Contents

require 'spec_helper'

describe MurmurHash do
  it "update nil" do
    all_classes.each do |c|
      murmur = c.new
      expect{ murmur.update }.to raise_error(ArgumentError)
    end
  end

  it "rawdigest no arguments" do
    all_classes.each do |c|
      expect{ c.rawdigest }.to raise_error(ArgumentError)
    end
  end

  it "seed digest" do
    all_classes.each do |c|
      expect{ c.digest "", ""}.to raise_error(ArgumentError)
      expect{ c.digest "", "\x00" }.to raise_error(ArgumentError)
      seed = (c::DEFAULT_SEED.bytesize == 4) ? seed32 : seed64
      expect{ c.digest "", seed }.to_not raise_error
    end
  end

  it "seed instance" do
    all_classes.each do |c|
      murmur = c.new
      expect{ murmur.seed = "" }.to raise_error(ArgumentError)
      expect{ murmur.seed = "\x00" }.to raise_error(ArgumentError)
      seed = (c::DEFAULT_SEED.bytesize == 4) ? seed32 : seed64
      expect{ murmur.seed = seed }.to_not raise_error
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
digest-murmurhash-1.0.0 spec/exception_spec.rb