<commit_before># encoding: utf-8

require 'spec_helper'
require 'ice_nine'

describe IceNine::Freezer::Hash, '.deep_freeze' do
  subject { object.deep_freeze(value) }

  let(:object) { described_class }

  context 'with a Hash object having a default proc' do
    let(:value) do
      Hash.new {}.update(Object.new => Object.new)
    end

    it_behaves_like 'IceNine::Freezer::Hash.deep_freeze'

    it 'freezes the default proc' do
      expect(subject.default_proc).to be_frozen
    end
  end

  context 'with a Hash object having a default value' do
    let(:value) do
      Hash.new('').update(Object.new => Object.new)
    end

    it_behaves_like 'IceNine::Freezer::Hash.deep_freeze'

    it 'freezes the default value' do
      expect(subject.default).to be_frozen
    end

    context 'that is a circular reference' do
      before { value.default = value }

      it_behaves_like 'IceNine::Freezer::Hash.deep_freeze'<commit_msg>#11 Fix spacing in empty curly braces<commit_after># encoding: utf-8

require 'spec_helper'
require 'ice_nine'

describe IceNine::Freezer::Hash, '.deep_freeze' do
  subject { object.deep_freeze(value) }

  let(:object) { described_class }

  context 'with a Hash object having a default proc' do
    let(:value) do
      Hash.new { }.update(Object.new => Object.new)
    end

    it_behaves_like 'IceNine::Freezer::Hash.deep_freeze'

    it 'freezes the default proc' do
      expect(subject.default_proc).to be_frozen
    end
  end

  context 'with a Hash object having a default value' do
    let(:value) do
      Hash.new('').update(Object.new => Object.new)
    end

    it_behaves_like 'IceNine::Freezer::Hash.deep_freeze'

    it 'freezes the default value' do
      expect(subject.default).to be_frozen
    end

    context 'that is a circular reference' do
      before { value.default = value }

      it_behaves_like 'IceNine::Freezer::Hash.deep_freeze'
{'fraction_non_alphanumeric': 0.10468174644923724, 'fraction_numerical': 0.0021041557075223566, 'mean_word_length': 3.464788732394366, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4939873', 'n_tokens_mistral': 659, 'n_tokens_neox': 617, 'n_words': 167}