<commit_before>require 'spec_helper'

describe Repository do
  setup_hets

  let(:repository) { create :repository_with_remote }

  context 'when ontohub clones a remote repository' do
    it 'should create a bulk job on a queue' do
      expect { repository.remote_send('clone') }.
        to change(OntologyBatchParseWorker.jobs, :size)
    end

    it 'should run the ontology import on the cloned repository', process_jobs_synchronously: true do
      skip 'Fails cause it needs time-specific stubbing!'
      expect { repository.remote_send('clone') }.
        not_to raise_error
    end
  end
end<commit_msg>fix failing test with versioned-hets stubbing<commit_after>require 'spec_helper'

describe Repository do
  setup_hets

  let(:repository) { create :repository_with_remote }

  context 'when ontohub clones a remote repository' do

    before do
      stub_hets_for(hets_out_file('cat1'), with: 'cat', with_version: 1)
      stub_hets_for(hets_out_file('cat2'), with: 'cat', with_version: 2)
      stub_hets_for(hets_out_file('Px'), with: 'Px')
    end

    after do
      FileUtils.rm_rf(repository.source_address)
    end

    it 'should create a bulk job on a queue' do
      expect { repository.remote_send('clone') }.
        to change(OntologyBatchParseWorker.jobs, :size)
    end

    it 'should run the ontology import on the cloned repository', process_jobs_synchronously: true do
      expect { repository.remote_send('clone') }.
        not_to raise_error
    end
  end
end
{'fraction_non_alphanumeric': 0.08221925133689839, 'fraction_numerical': 0.00267379679144385, 'mean_word_length': 3.6203703703703702, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '346180', 'n_tokens_mistral': 475, 'n_tokens_neox': 454, 'n_words': 137}