<commit_before>require 'spec_helper'

describe GitNetworkitis::Getter do

  describe ".initialize" do
    it "should separate local options from query options" do
      getter = GitNetworkitis::Getter.new('url',
                                          access_token: "token",
                                          per_page: 100,
                                          batch: true,
                                          branch: 'branch',
                                          since: 'sha')
      getter.local_options.should == {batch: true, branch: 'branch', since: 'sha'}
      getter.query_options.should == {access_token: "token", per_page: 100}
    end
  end

  describe "#get" do
    it "should default the per_page option to 100" do

    end

    it "should perform a regular GET when no batch nor since options are set" do
      getter = GitNetworkitis::Getter.new('url', access_token: 'token')
      getter.should_receive(:single_get)
      getter.get
    end

    it "should perform a batched GET when batch is true and since isn't set" do
      getter = GitNetworkitis::Getter.new('url', access_token: 'token', batch: true)
      getter.should_receive(:batched_get)
      getter.get
    end
  end<commit_msg>fixes broken spec related to removal of :branch option from Getter<commit_after>require 'spec_helper'

describe GitNetworkitis::Getter do

  describe ".initialize" do
    it "should separate local options from query options" do
      getter = GitNetworkitis::Getter.new('url',
                                          access_token: "token",
                                          per_page: 100,
                                          batch: true,
                                          since: 'sha')
      getter.local_options.should == {batch: true, since: 'sha'}
      getter.query_options.should == {access_token: "token", per_page: 100}
    end
  end

  describe "#get" do
    it "should default the per_page option to 100" do

    end

    it "should perform a regular GET when no batch nor since options are set" do
      getter = GitNetworkitis::Getter.new('url', access_token: 'token')
      getter.should_receive(:single_get)
      getter.get
    end

    it "should perform a batched GET when batch is true and since isn't set" do
      getter = GitNetworkitis::Getter.new('url', access_token: 'token', batch: true)
      getter.should_receive(:batched_get)
      getter.get
    end
  end
{'fraction_non_alphanumeric': 0.08562064727570667, 'fraction_numerical': 0.007374027038099139, 'mean_word_length': 1.9671931956257593, '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': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2534915', 'n_tokens_mistral': 655, 'n_tokens_neox': 626, 'n_words': 211}