<commit_before>
require 'rest-more/test'

describe RC::Twitter do
  after do
    WebMock.reset!
    RR.verify
  end

  should 'get right' do
    stub_request(:get,
      'https://api.twitter.com/1.1/account/verify_credentials.json').
      to_return(:body => '{"status": "OK"}')

    RC::Twitter.new.me.should.eq({'status' => 'OK'})
  end

#  def check status, klass
#    stub_request(:delete, 'https://api.twitter.com/123').to_return(
#      :body => '{}', :status => status)
#
#    lambda{
#      RC::Twitter.new.delete('123').tap{}
#    }.should.raise(klass)
#
#    WebMock.reset!
#  end
#
#  should 'raise exception when encountering error' do
#    [401, 402, 403].each{ |status|
#      check(status, RestCore::Twitter::Error)
#    }
#
#    [500, 502, 503].each{ |status|
#      check(status, RestCore::Twitter::Error::ServerError)
#    }
#  end
end<commit_msg>twitter/test_api.rb: restore the tests<commit_after>
require 'rest-more/test'

describe RC::Twitter do
  after do
    WebMock.reset!
    RR.verify
  end

  should 'get right' do
    stub_request(:get,
      'https://api.twitter.com/1.1/account/verify_credentials.json').
      to_return(:body => '{"status": "OK"}')

    RC::Twitter.new.me.should.eq({'status' => 'OK'})
  end

  def check status, klass
    stub_request(:delete, 'https://api.twitter.com/123').to_return(
      :body => '{}', :status => status)

    lambda{
      RC::Twitter.new.delete('123').tap{}
    }.should.raise(klass)

    WebMock.reset!
  end

  should 'raise exception when encountering error' do
    [401, 402, 403].each{ |status|
      check(status, RestCore::Twitter::Error)
    }

    [500, 502, 503].each{ |status|
      check(status, RestCore::Twitter::Error::ServerError)
    }
  end
end
{'fraction_non_alphanumeric': 0.1780979827089337, 'fraction_numerical': 0.029971181556195964, 'mean_word_length': 3.1932367149758454, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 4, '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': '1747219', 'n_tokens_mistral': 671, 'n_tokens_neox': 611, 'n_words': 118}