```ruby
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
```

Add unit test to test for spaces in realm name
user
```ruby
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
```
assistant