<commit_before>require 'rubygems'
require 'test/unit'
require 'shoulda'
require 'redgreen'
require 'fakeweb'
require 'rr'

FakeWeb.allow_net_connect = false

require File.join("lib", "rubygems_plugin")
%w(push upgrade downgrade).each do |command|
  require File.join("lib", "commands", command)
end

class PluginTest < Test::Unit::TestCase
  include RR::Adapters::TestUnit unless include?(RR::Adapters::TestUnit)

  context "pushing" do
    setup do
      @command = Gem::Commands::PushCommand.new
      stub(@command).say
    end

    should "sign in then push if no api key" do
      stub(Gem).configuration { {:gemcutter_key => nil} }<commit_msg>Requiring fakeweb >= 1.2.5<commit_after>require 'rubygems'
require 'test/unit'
require 'shoulda'
require 'redgreen'
gem 'fakeweb', '>= 1.2.5'
require 'fakeweb'
require 'rr'

FakeWeb.allow_net_connect = false

require File.join("lib", "rubygems_plugin")
%w(push upgrade downgrade).each do |command|
  require File.join("lib", "commands", command)
end

class PluginTest < Test::Unit::TestCase
  include RR::Adapters::TestUnit unless include?(RR::Adapters::TestUnit)

  context "pushing" do
    setup do
      @command = Gem::Commands::PushCommand.new
      stub(@command).say
    end

    should "sign in then push if no api key" do
      stub(Gem).configuration { {:gemcutter_key => nil} }
{'fraction_non_alphanumeric': 0.1323859386686612, 'fraction_numerical': 0.004487658937920718, 'mean_word_length': 4.767241379310345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4706080', 'n_tokens_mistral': 444, 'n_tokens_neox': 436, 'n_words': 117}