Sha256: 6079ae5e0ab2f2c3d7053b62c2626f1e0df5ffc7a4aa7b54f0dc624857cb4345

Contents?: true

Size: 355 Bytes

Versions: 12

Compression:

Stored size: 355 Bytes

Contents

require_relative '../lib/inline_svg/id_generator'

describe InlineSvg::IdGenerator do
  it "generates a hexencoded ID based on a salt and a random value" do
    randomizer = -> { "some-random-value" }

    expect(InlineSvg::IdGenerator.generate("some-base", "some-salt", randomness: randomizer)).
      to eq("at2c17mkqnvopy36iccxspura7wnreqf")
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
inline_svg-1.10.0 spec/id_generator_spec.rb
inline_svg-1.9.0 spec/id_generator_spec.rb
inline_svg-1.8.0 spec/id_generator_spec.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/inline_svg-1.7.2/spec/id_generator_spec.rb
inline_svg-1.7.2 spec/id_generator_spec.rb
inline_svg-1.7.1 spec/id_generator_spec.rb
inline_svg-1.7.0 spec/id_generator_spec.rb
inline_svg-1.6.0 spec/id_generator_spec.rb
inline_svg-1.5.2 spec/id_generator_spec.rb
inline_svg-1.5.1 spec/id_generator_spec.rb
inline_svg-1.5.0 spec/id_generator_spec.rb
inline_svg-1.4.0 spec/id_generator_spec.rb