<commit_before>require "test/unit"

$LOAD_PATH.unshift("#{File.dirname(__FILE__)}")
require "test_helper"
require "random_token"
require "length/test_length"
require "length/test_case"
require "length/test_friendly"
require "length/test_seed"
require "length/test_mask"
require "length/test_hash_seed"
require "format/test_pattern"
require "format/test_percent"

class TestGen < Test::Unit::TestCase
  def test_gen_should_raise_an_exception_if_the_given_arg_is_invalid
    e = assert_raise(RandomToken::RandomTokenError) { RandomToken.gen(nil) }
    assert(e.code == :invalid_gen_arg)
  end

  def test_gen_should_raise_an_exception_if_the_given_options_are_duplicated
    e = assert_raise(RandomToken::RandomTokenError) { RandomToken.gen(8, s: :a, seed: :o) }
    assert(e.code == :duplicated_option)
  end

  def test_gen_should_raise_an_exception_if_the_given_option_values_are_invalid
    invalid_value = 'invalid_value'
    e = assert_raise(RandomToken::RandomTokenError) { RandomToken.gen(8, c: invalid_value) }
    assert(e.code == :invalid_option_value)
  end
end<commit_msg>Change hash style to 1.8.7 in tests<commit_after>require "test/unit"

$LOAD_PATH.unshift("#{File.dirname(__FILE__)}")
require "test_helper"
require "random_token"
require "length/test_length"
require "length/test_case"
require "length/test_friendly"
require "length/test_seed"
require "length/test_mask"
require "length/test_hash_seed"
require "format/test_pattern"
require "format/test_percent"

class TestGen < Test::Unit::TestCase
  def test_gen_should_raise_an_exception_if_the_given_arg_is_invalid
    e = assert_raise(RandomToken::RandomTokenError) { RandomToken.gen(nil) }
    assert(e.code == :invalid_gen_arg)
  end

  def test_gen_should_raise_an_exception_if_the_given_options_are_duplicated
    e = assert_raise(RandomToken::RandomTokenError) { RandomToken.gen(8, :s => :a, :seed => :o) }
    assert(e.code == :duplicated_option)
  end

  def test_gen_should_raise_an_exception_if_the_given_option_values_are_invalid
    invalid_value = 'invalid_value'
    e = assert_raise(RandomToken::RandomTokenError) { RandomToken.gen(8, :c => invalid_value) }
    assert(e.code == :invalid_option_value)
  end
end
{'fraction_non_alphanumeric': 0.10377787892580792, 'fraction_numerical': 0.0031861629494765588, 'mean_word_length': 6.906474820143885, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3661398', 'n_tokens_mistral': 759, 'n_tokens_neox': 747, 'n_words': 123}