<commit_before>require 'abstract_unit'

class MessageVerifierTest < Test::Unit::TestCase
  def setup
    @verifier = ActiveSupport::MessageVerifier.new("Hey, I'm a secret!")
    @data = {:some=>"data", :now=>Time.now}
  end
  
  def test_simple_round_tripping
    message = @verifier.generate(@data)
    assert_equal @data, @verifier.verify(message)
  end
  
  def test_tampered_data_raises
    data, hash = @verifier.generate(@data).split("--")<commit_msg>Test with MD5 digest in an attempt to mollify CI<commit_after>require 'abstract_unit'

class MessageVerifierTest < Test::Unit::TestCase
  def setup
    @verifier = ActiveSupport::MessageVerifier.new("Hey, I'm a secret!", 'MD5')
    @data = {:some=>"data", :now=>Time.now}
  end
  
  def test_simple_round_tripping
    message = @verifier.generate(@data)
    assert_equal @data, @verifier.verify(message)
  end
  
  def test_tampered_data_raises
    data, hash = @verifier.generate(@data).split("--")
{'fraction_non_alphanumeric': 0.13284518828451883, 'fraction_numerical': 0.0020920502092050207, 'mean_word_length': 4.730538922155689, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1876107', 'n_tokens_mistral': 328, 'n_tokens_neox': 319, 'n_words': 67}