<commit_before>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'gotcha'
require 'stringio'

describe "Gotcha" do
  before do
    @gotcha = Gotcha.new
  end
  it 'should have Artifact::Repository::Cache as first repository' do
    @gotcha.repositories[0].should be_a Artifact::Finder::FileSystem
  end

  describe 'define' do
    @url = 'http://github.com'
    before do
      @finder = @gotcha.define(@url)
    end
    describe '"http://github.com"' do
      it 'should return a new rest finder with url' do
        @finder.should be_kind_of(Artifact::Finder::Rest)
        @finder.url.should == @url
      end
    end
  end
end

describe 'Gotcha.get' do
  before do<commit_msg>define adds finder to list of finders<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'gotcha'
require 'stringio'

describe "Gotcha" do
  before do
    @gotcha = Gotcha.new
  end
  it 'should have Artifact::Repository::Cache as first repository' do
    @gotcha.repositories[0].should be_a Artifact::Finder::FileSystem
  end

  describe 'define' do
    @url = 'http://github.com'
    before do
      @finder = @gotcha.define(@url)
    end
    describe '"http://github.com"' do
      it 'should return a new rest finder with url' do
        @finder.should be_kind_of(Artifact::Finder::Rest)
        @finder.url.should == @url
      end
      it 'finder should be last repository' do
        @gotcha.repositories.last.should == @finder
      end
    end
  end
end

describe 'Gotcha.get' do
  before do
{'fraction_non_alphanumeric': 0.11096690460739779, 'fraction_numerical': 0.0012978585334198572, 'mean_word_length': 3.2016348773841963, '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': '70776', 'n_tokens_mistral': 505, 'n_tokens_neox': 490, 'n_words': 141}