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

describe Cpgem::Gem do

  context "when invalid gem" do

    use_vcr_cassette "invalid_gem", :record => :new_episodes

    it "should raise error" do
      expect { Cpgem::Gem.info("xpto_gem_not_found") }.to raise_error(/This rubygem could not be found./)
    end

  end

  context "when search" do

    use_vcr_cassette "search_googl", :record => :new_episodes

    it "should return some basic information about the gem" do
      info = Cpgem::Gem.info("googl")
      info.should == {"dependencies"=>{"runtime"=>[{"name"=>"httparty", "requirements"=>">= 0.6.1"}, {"name"=>"json", "requirements"=>">= 1.4.6"}], "development"=>[{"name"=>"bundler", "requirements"=>"~> 1.0.0"}, {"name"=>"jeweler", "requirements"=>"~> 1.5.2"}, {"name"=>"rcov", "requirements"=>">= 0"}, {"name"=>"rspec", "requirements"=>"~> 2.3.0"}, {"name"=>"webmock", "requirements"=>"~> 1.6.2"}]}, "name"=>"googl", "downloads"=>3854, "info"=>"Small library for Google URL Shortener API", "version_downloads"=>1357, "version"=>"0.5.0", "homepage_uri"=>"http://github.com/zigotto/googl", "bug_tracker_uri"=>"https://github.com/zigotto/googl/issues", "source_code_uri"=>"https://github.com/zigotto/googl", "gem_uri"=>"http://rubygems.org/gems/googl-0.5.0.gem", "project_uri"=>"http://rubygems.org/gems/googl", "authors"=>"<NAME>", "mailing_list_uri"=>"", "documentation_uri"=>"", "wiki_uri"=>""} 
    end

  end

end<commit_msg>Cleaning Gem tests<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Cpgem::Gem do

  context "when invalid gem" do

    use_vcr_cassette "invalid_gem", :record => :new_episodes

    it "should raise error" do
      expect { Cpgem::Gem.info("xpto_gem_not_found") }.to raise_error(/This rubygem could not be found./)
    end

  end

  context "basic information about the gem" do

    use_vcr_cassette "search_googl", :record => :new_episodes

    let(:info) {
      Cpgem::Gem.info("googl")
    }

    it "should return dependencies" do
      info["dependencies"].should == {
        "runtime"=>[{"name"=>"httparty", "requirements"=>">= 0.6.1"}, {"name"=>"json", "requirements"=>">= 1.4.6"}], 
        "development"=>[{"name"=>"bundler", "requirements"=>"~> 1.0.0"}, {"name"=>"jeweler", "requirements"=>"~> 1.5.2"}, {"name"=>"rcov", "requirements"=>">= 0"}, {"name"=>"rspec", "requirements"=>"~> 2.3.0"}, {"name"=>"webmock", "requirements"=>"~> 1.6.2"}]
      }
    end

    it { info["name"].should == "googl" }
    it { info["downloads"].should == 3854 }
    it { info["info"].should == "Small library for Google URL Shortener API" }
    it { info["version_downloads"].should == 1357 }
    it { info["version"].should == "0.5.0" }
    it { info["homepage_uri"].should == "http://github.com/zigotto/googl" }
    it { info["bug_tracker_uri"].should == "https://github.com/zigotto/googl/issues" }
    it { info["source_code_uri"].should == "https://github.com/zigotto/googl" }
    it { info["gem_uri"].should == "http://rubygems.org/gems/googl-0.5.0.gem" }
    it { info["project_uri"].should == "http://rubygems.org/gems/googl" }
    it { info["authors"].should == "<NAME>" }
    it { info["mailing_list_uri"].should == "" }
    it { info["documentation_uri"].should == "" }
    it { info["wiki_uri"].should == "" }

  end

end
{'fraction_non_alphanumeric': 0.22867404968572283, 'fraction_numerical': 0.019754564501646213, 'mean_word_length': 4.496710526315789, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 70, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6463854', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1238, 'n_words': 216}