<commit_before>require 'spec_helper'
require 'vcr_helper'

RSpec.describe GroSocial::Client do
  before(:each) { Singleton.__init__(GroSocial::Client) }

  describe '.api_key' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:api_key)
    end
  end

  describe '.api_key=' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:api_key=)
    end

    it 'sets api_key value' do
      GroSocial::Client.api_key = 'secret'
      expect(GroSocial::Client.api_key).to eq('secret')
    end
  end

  describe '.api_password' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:api_password)
    end
  end

  describe '.api_password=' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:api_password=)
    end

    it 'sets api_password value' do
      GroSocial::Client.api_password = '<PASSWORD>'
      expect(GroSocial::Client.api_password).to eq('<PASSWORD>')
    end
  end

  describe '.request' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:request)
    end
  end

  describe '.api_url' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:api_url)
    end
  end

  describe '.test_mode=' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:test_mode=)
    end

    it 'sets test_mode value' do
      GroSocial::Client.test_mode = true
      expect(GroSocial::Client.test_mode).to be_truthy
    end
  end

  describe '.test_mode' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:test_mode)
    end

    it 'defaults to false' do
      expect(GroSocial::Client.test_mode).to be_falsey
    end

    context 'when set to true' do
      before(:each) do
        GroSocial::Client.test_mode = true
      end

      it 'causes requests to go to https://apidev.grosocial.com' do
        expect(GroSocial::Client.api_url).to eq('https://apidev.grosocial.com')
      end
    end

    context 'when set to false' do
      before(:each) do
        GroSocial::Client.test_mode = false
      end

      it 'causes requests to go to https://api.grosocial.com' do
        expect(GroSocial::Client.api_url).to eq('https://api.grosocial.com')
      end
    end
  end
end<commit_msg>Adjusted spec descriptions.<commit_after>require 'spec_helper'
require 'vcr_helper'

RSpec.describe GroSocial::Client do
  before(:each) { Singleton.__init__(GroSocial::Client) }

  describe '.api_key' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:api_key)
    end
  end

  describe '.api_key=' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:api_key=)
    end

    it 'sets api_key value' do
      GroSocial::Client.api_key = 'secret'
      expect(GroSocial::Client.api_key).to eq('secret')
    end
  end

  describe '.api_password' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:api_password)
    end
  end

  describe '.api_password=' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:api_password=)
    end

    it 'sets api_password value' do
      GroSocial::Client.api_password = '<PASSWORD>'
      expect(GroSocial::Client.api_password).to eq('<PASSWORD>')
    end
  end

  describe '.request' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:request)
    end
  end

  describe '.api_url' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:api_url)
    end
  end

  describe '.test_mode=' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:test_mode=)
    end

    it 'sets test_mode value' do
      GroSocial::Client.test_mode = true
      expect(GroSocial::Client.test_mode).to be_truthy
    end
  end

  describe '.test_mode' do
    it 'responds' do
      expect(GroSocial::Client).to respond_to(:test_mode)
    end

    it 'defaults to false' do
      expect(GroSocial::Client.test_mode).to be_falsey
    end

    context 'when set to true' do
      before(:each) do
        GroSocial::Client.test_mode = true
      end

      it 'causes .api_url to return \'https://apidev.grosocial.com\'' do
        expect(GroSocial::Client.api_url).to eq('https://apidev.grosocial.com')
      end
    end

    context 'when set to false' do
      before(:each) do
        GroSocial::Client.test_mode = false
      end

      it 'causes .api_url to return \'https://api.grosocial.com\'' do
        expect(GroSocial::Client.api_url).to eq('https://api.grosocial.com')
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11521252796420582, 'fraction_numerical': 0.0, 'mean_word_length': 2.9357394366197185, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, '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': '5913164', 'n_tokens_mistral': 1568, 'n_tokens_neox': 1459, 'n_words': 347}