<commit_before>describe UptimeRobot::Client do
  describe '#get_account_details' do
    let(:account) do
      {"monitorLimit"=>"100",
       "upMonitors"=>"35",
       "downMonitors"=>"9",
       "pausedMonitors"=>"11"}
     end

    let(:response) do
      {"stat"=>"ok",
       "account"=>account}
    end

    it do
      client = uptime_robot do |stub|
        stub.get('getAccountDetails') do |env|
          expect(env.params).to eq DEFAULT_PARAMS
          [200, {'Content-Type' => 'json'}, JSON.dump(response)]
        end
      end

      expect(client.get_account_details).to eq account
    end
  end
end
<commit_msg>Add fail test case<commit_after>describe UptimeRobot::Client do
  describe '#get_account_details' do
    let(:account) do
      {"monitorLimit"=>"100",
       "upMonitors"=>"35",
       "downMonitors"=>"9",
       "pausedMonitors"=>"11"}
     end

    let(:response) do
      {"stat"=>"ok",
       "account"=>account}
    end

    it do
      client = uptime_robot do |stub|
        stub.get('getAccountDetails') do |env|
          expect(env.params).to eq DEFAULT_PARAMS
          [200, {'Content-Type' => 'json'}, JSON.dump(response)]
        end
      end

      expect(client.get_account_details).to eq account
    end
  end

  context 'when stat is fail' do
    let(:response) do
      {"stat"=>"fail", "id"=>"101", "message"=>"apiKey is wrong"}
    end

    it do
      client = uptime_robot do |stub|
        stub.get('getAccountDetails') do |env|
          expect(env.params).to eq DEFAULT_PARAMS
          [200, {'Content-Type' => 'json'}, JSON.dump(response)]
        end
      end

      expect {
        client.get_account_details
      }.to raise_error(UptimeRobot::Error, response.inspect)
    end
  end
end

{'fraction_non_alphanumeric': 0.14114285714285715, 'fraction_numerical': 0.016, 'mean_word_length': 2.4673267326732673, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '1429791', 'n_tokens_mistral': 602, 'n_tokens_neox': 574, 'n_words': 126}