<commit_before>require 'battlenet/api'

describe Battlenet::Client do
  it "should allow you to configure it for a valid region" do
    Battlenet.configure do |config|
      config.api_key = 'test-api'
      config.region  = :eu
    end

    a = Battlenet.WOWClient
    expect(a.region).to eq(:eu)

    Battlenet.configure do |config|
      config.region = :us
    end

    b = Battlenet.WOWClient
    expect(b.region).to eq(:us)
    
  end
end<commit_msg>Add unit test to test for spaces in realm name<commit_after>require 'battlenet/api'

describe Battlenet::Client do
  context "when special characters are in realm names" do
    before do
      Battlenet.configure do |config|
        config.api_key = 'test-api'
        config.region  = :eu
      end
    end

    it "should escape spaces in realm names" do
      c = Battlenet::Client.new({domain: 'http://www.test.com', endpoint: "/emerald dream/mal'ganis"})
      expect(c.endpoint).to eq('/emerald%20dream/mal\'ganis')
    end
  end
end
{'fraction_non_alphanumeric': 0.10452261306532663, 'fraction_numerical': 0.0020100502512562816, 'mean_word_length': 2.86046511627907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '5254506', 'n_tokens_mistral': 335, 'n_tokens_neox': 326, 'n_words': 93}