var RegistryClient = require('../Client'),
    expect = require('chai').expect;

describe('RegistryClient', function () {

    beforeEach(function () {
        this.uri = 'https://bower.herokuapp.com';
        this.timeoutVal = 5000;
        this.client = new RegistryClient();
        this.conf = {
            search: [this.uri],
            register: this.uri,
            publish: this.uri
        };
    });

    describe('Constructor', function () {

        describe('instantiating a client without custom options', function () {

            it('should provide an instance of RegistryClient', function () {
                expect(this.client instanceof RegistryClient).to.be.ok;
            });

            it('should set properties correctly', function () {
                expect(this.client).to.have.ownProperty('_config');
                expect(this.client).to.have.ownProperty('_cache');
                expect(this.client).to.have.ownProperty('_lookupCache');
                expect(this.client).to.have.ownProperty('_searchCache');
                expect(this.client).to.have.ownProperty('_listCache');
            });

            it('should set default registry config', function () {
                expect(this.client._config.registry).to.deep.equal(this.conf);
            });

            it('should set default search config', function () {
                expect(this.client._config.registry.search[0]).to.equal(this.uri);
            });

            it('should set default register config', function () {
                expect(this.client._config.registry.register).to.equal(this.uri);
            });

            it('should set default publish config', function () {
                expect(this.client._config.registry.publish).to.equal(this.uri);
            });

            it('should set default cache path config', function () {
                expect(typeof this.client._config.cache === 'string').to.be.ok;
            });

            it('should set default timeout config', function () {
                expect(this.client._config.timeout).to.equal(this.timeoutVal);
            });

            it('should set default strictSsl config', function () {
                expect(this.client._config.strictSsl).to.be.ok;
            });

        });

        it('should have a lookup prototype method', function () {
            expect(RegistryClient.prototype).to.have.ownProperty('lookup');
        });

        it('should have a search prototype method', function () {
            expect(RegistryClient.prototype).to.have.ownProperty('search');
        });

        it('should have a list prototype method', function () {
            expect(RegistryClient.prototype).to.have.ownProperty('list');
        });

        it('should have a register prototype method', function () {
            expect(RegistryClient.prototype).to.have.ownProperty('register');
        });

        it('should have a clearCache prototype method', function () {
            expect(RegistryClient.prototype).to.have.ownProperty('clearCache');
        });

        it('should have a clearRuntimeCache prototype method', function () {
            expect(RegistryClient.prototype).to.have.ownProperty('clearRuntimeCache');
        });

        it('should have a _initCache prototype method', function () {
            expect(RegistryClient.prototype).to.have.ownProperty('_initCache');
        });

    });

});

@@ -240,22 +240,24 @@
    this.
-client
+registry
  = new R
@@ -638,22 +638,24 @@
 ct(this.
-client
+registry
  instanc
@@ -785,38 +785,40 @@
     expect(this.
-client
+registry
 ).to.have.ownPro
@@ -855,38 +855,40 @@
     expect(this.
-client
+registry
 ).to.have.ownPro
@@ -924,38 +924,40 @@
     expect(this.
-client
+registry
 ).to.have.ownPro
@@ -999,38 +999,40 @@
     expect(this.
-client
+registry
 ).to.have.ownPro
@@ -1082,22 +1082,24 @@
 ct(this.
-client
+registry
 ).to.hav
@@ -1231,38 +1231,40 @@
     expect(this.
-client
+registry
 ._config.registr
@@ -1394,38 +1394,40 @@
     expect(this.
-client
+registry
 ._config.registr
@@ -1563,38 +1563,40 @@
     expect(this.
-client
+registry
 ._config.registr
@@ -1730,38 +1730,40 @@
     expect(this.
-client
+registry
 ._config.registr
@@ -1910,30 +1910,32 @@
 typeof this.
-client
+registry
 ._config.cac
@@ -2064,38 +2064,40 @@
     expect(this.
-client
+registry
 ._config.timeout
@@ -2238,22 +2238,24 @@
 ct(this.
-client
+registry
 ._config

rename client -> registry