/* global cash, Cash */
(function () {
    'use strict';
    var cash;
    describe('cashex', function () {
        var prefixed, conversationalE, magnitude, suffixed, casual, formal, conversational, symbolic;
        beforeEach(function () {
            cash = new Cash();
            cash.setValues({"USD": 1}).lookFor("USD", "EUR");
            prefixed = '$5';
            suffixed = '5 dollars';
            casual = 'five bucks';
            formal = 'USD 5.00';
            conversational = 'five American dollars';
            conversationalE = '5 euros';
            magnitude = 'five cents';
            symbolic = 'five $';
        });
        afterEach(function () {
            cash = conversationalE = magnitude = prefixed = suffixed = casual = formal = conversational = symbolic = null;
        });

        it('should capture whether a cash expression is prefixed with the currency type', function () {
            cash.tag(prefixed);
            var cache = cash.register.cache;
            expect(cache[Object.keys(cache)[0]].prefixed).toBe(true);
            delete cache[Object.keys(cache)[0]];

            cash.tag(suffixed);
            expect(cache[Object.keys(cache)[0]].prefixed).toBe(false);
        });

        it('should capture the voice of a cash expression', function () {
            cash.tag(casual);
            var cache = cash.register.cache;
            expect(cache[Object.keys(cache)[0]].voice).toBe('casual');
            delete cache[Object.keys(cache)[0]];

            cash.tag(formal);
            expect(cache[Object.keys(cache)[0]].voice).toBe('formal');
            delete cache[Object.keys(cache)[0]];

            cash.tag(conversational);
            expect(cache[Object.keys(cache)[0]].voice).toBe('conversational');
            delete cache[Object.keys(cache)[0]];

            cash.tag(conversationalE);
            expect(cache[Object.keys(cache)[0]].voice).toBe('conversational');
            delete cache[Object.keys(cache)[0]];

            cash.tag(symbolic);
            expect(cache[Object.keys(cache)[0]].voice).toBe('symbolic');
            delete cache[Object.keys(cache)[0]];

            cash.tag(magnitude);
            expect(cache[Object.keys(cache)[0]].voice).toBe('conversational');
            delete cache[Object.keys(cache)[0]];
        });
    });
})();

@@ -299,16 +299,92 @@
 es(%7B
-%22USD%22: 1
+%0A              %22USD%22: 1,%0A              %22EUR%22: 2,%0A              %22GBP%22: 3%0A            
 %7D).l
@@ -2380,24 +2380,612 @@
 %0A        %7D);
+%0A%0A        describe('when calling exchange', function () %7B%0A            beforeEach(function () %7B%0A              $('body').append('%3Cdiv id=%22maintain-voice%22%3E%3C/div%3E');%0A            %7D);%0A            afterEach(function () %7B%0A              $('#maintain-voice').remove();%0A            %7D);%0A%0A            it('should maintain voice when exchanging currencies', function () %7B%0A              $('#maintain-voice').html(cash.tag(casual));%0A              cash.exchange('USD').for('GBP');%0A              expect($('#maintain-voice').children('.cash-node').first().text()).toBe('15 quid');%0A            %7D);%0A        %7D);
 %0A    %7D);%0A%7D)(

add spec for maintaining voice