<commit_before>shared_examples_for 'Tag (with fixtures)' do

  let (:tag_class) { described_class }
  let (:tag_hierarchy_class) { described_class.hierarchy_class }

  describe 'Tag (with fixtures)' do
    fixtures :tags
    before do
      tag_class.rebuild!
      DestroyedTag.delete_all
    end

    context 'adding children' do
      it 'should work explicitly' do
        sb = Tag.create!(:name => '<NAME>')
        sb.leaf?.should_not be_nil
        tags(:california).add_child sb
        sb.leaf?.should_not be_nil
        validate_city_tag sb
      end

      it 'should work implicitly through the collection' do
        eg = Tag.create!(:name => '<NAME>')<commit_msg>call instantiate_fixtures to ensure the fixtures are in the db<commit_after>shared_examples_for 'Tag (with fixtures)' do

  let (:tag_class) { described_class }
  let (:tag_hierarchy_class) { described_class.hierarchy_class }

  describe 'Tag (with fixtures)' do
    fixtures :tags
    before :each do
      # We have to force-re-instantiate the fixtures because the parallel specs wipe the db:
      instantiate_fixtures
      tag_class.rebuild!
      DestroyedTag.delete_all
    end

    context 'adding children' do
      it 'should work explicitly' do
        sb = Tag.create!(:name => '<NAME>')
        sb.leaf?.should_not be_nil
        tags(:california).add_child sb
        sb.leaf?.should_not be_nil
        validate_city_tag sb
      end

      it 'should work implicitly through the collection' do
        eg = Tag.create!(:name => '<NAME>')
{'fraction_non_alphanumeric': 0.08960104643557881, 'fraction_numerical': 0.0, 'mean_word_length': 2.9030612244897958, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '4796154', 'n_tokens_mistral': 478, 'n_tokens_neox': 448, 'n_words': 133}