var expect = require('chai').expect
  , types = require('../../..')
  , ArgumentTypeError = types.ArgumentTypeError
  , define = require('cli-define')
  , Option = define.Option;

describe('cli-types:', function() {
  var pi = 3.14159265359;
  var golden = 1.61803398875;
  it('should coerce single value to float', function(done) {
    var value = '' + pi;
    var opt = new Option(
      '-f, --float <float>', 'a float argument');
    var res = types.float(value, opt);
    expect(res).to.eql(pi);
    done();
  });
  it('should error on invalid float', function(done) {
    var value = 'xyz';
    var opt = new Option(
      '-f, --float <float>', 'a float argument');
    function func() {
      types.float(value, opt);
    }
    expect(func).to.throw(ArgumentTypeError);
    done();
  });
  //it('should coerce multiple values to array of floats', function(done) {
    //var cli = require('../../..')(pkg);
    //cli.configure({exit:false});
    //var args = ['-f', '' + pi, '--float=' + golden];
    //cli
      //.option('-f, --float <n...>', 'a float argument', types.float)
    //cli.parse(args);
    //expect(cli.float).to.eql([pi, golden]);
    //done();
  //});
  //it('should error on invalid float', function(done) {
    //var cli = require('../../..')(pkg);
    //cli.configure({exit:false});
    //var args = ['-f', 'xyz'];
    //cli
      //.once('error', function(e) {
        ////expect(cli).to.eql(this);
        ////expect(code).to.eql(codes.ETYPE);
        ////parameters.unshift(message);
        ////console.error.apply(null, parameters);
        //done();
      //})
      //.option('-f, --float <n>', 'a float argument', types.float)
    //cli.parse(args);
  //});
  //it('should error on invalid float in array', function(done) {
    //var cli = require('../../..')(pkg);
    //cli.configure({exit:false});
    //var args = ['-f', '' + pi, '--float=' + golden, '--float', 'zyx'];
    //cli
      //.once('error', function(e) {
        ////expect(cli).to.eql(this);
        ////expect(code).to.eql(codes.ETYPE);
        ////parameters.unshift(message);
        ////console.error.apply(null, parameters);
        //done();
      //})
      //.option('-f, --float <n...>', 'a float argument', types.float)
    //cli.parse(args);
  //});
})

@@ -265,16 +265,17 @@
 398875;%0A
+%0A
   it('sh
@@ -788,26 +788,24 @@
 ();%0A  %7D);%0A  
-//
 it('should c
@@ -807,49 +807,39 @@
 uld 
-coerce multiple values to array of floats
+error on invalid float in array
 ', f
@@ -862,162 +862,73 @@
     
-//
 var 
-cli = require('../../..')(pkg);%0A    //cli.configure(%7Bexit:false%7D)
+value = %5Bpi, golden, 'xyz'%5D
 ;%0A    
-//
 var 
-args = %5B'-f', '' + pi, '--float=' + golden%5D;%0A    //cli%0A      //.option(
+opt = new Option(%0A      
 '-f,
@@ -929,36 +929,37 @@
   '-f, --float %3C
-n...
+float
 %3E', 'a float arg
@@ -968,513 +968,120 @@
 ent'
-, types.float)%0A    //cli.parse(args);%0A    //expect(cli.float).to.eql(%5Bpi, golden%5D);%0A    //done();%0A  //%7D);%0A  //it('should error on invalid float', function(done) %7B%0A    //var cli = require('../../..')(pkg);%0A    //cli.configure(%7Bexit:false%7D);%0A    //var args = %5B'-f', 'xyz'%5D;%0A    //cli%0A      //.once('error', function(e) %7B%0A        ////expect(cli).to.eql(this
+);%0A    function func() %7B%0A      types.float(value, opt
 );%0A    
+%7D%0A
     
-////
 expect(
-code
+func
 ).to.
-eql(codes.ETYPE);%0A        ////parameters.unshift(message);%0A        ////console.error.apply(null, parameters
+throw(ArgumentTypeError
 );%0A    
-    //
 done
@@ -1090,162 +1090,66 @@
 ;%0A  
-    //%7D)%0A      //.option('-f, --float %3Cn%3E', 'a float argument', types.float)%0A    //cli.parse(args);%0A  //%7D);%0A  //it('should error on invalid float in array
+%7D);%0A  it('should coerce multiple values to array of floats
 ', f
@@ -1172,105 +1172,21 @@
     
-//
 var 
-cli = require('../../..')(pkg);%0A    //cli.configure(%7Bexit:false%7D);%0A    //var args = %5B'-f', 
+value = %5B
 '' +
@@ -1195,16 +1195,8 @@
 i, '
---float=
 ' + 
@@ -1205,297 +1205,43 @@
 lden
-, '--float', 'zyx'%5D;%0A    //cli%0A      //.once('error', function(e) %7B%0A        ////expect(cli).to.eql(this);%0A        ////expect(code).to.eql(codes.ETYPE);%0A        ////parameters.unshift(message);%0A        ////console.error.apply(null, parameters);%0A        //done();%0A      //%7D)%0A      //.option(
+%5D;%0A    var opt = new Option(%0A      
 '-f,
@@ -1254,12 +1254,13 @@
 at %3C
-n...
+float
 %3E', 
@@ -1281,50 +1281,102 @@
 ent'
-, types.float)%0A    //cli.parse(args);%0A  //
+);%0A    var res = types.float(value, opt);%0A    expect(res).to.eql(%5Bpi, golden%5D);%0A    done();%0A  
 %7D);%0A

Update float tests.