| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | 'use strict'; |
||
| 8 | describe('autoCast', function(){ |
||
| 9 | it('should cast to an integer', function(){ |
||
| 10 | expect(autoCast("42")).to.equal(42); |
||
| 11 | }) |
||
| 12 | |||
| 13 | it('should cast to a float', function(){ |
||
| 14 | expect(autoCast("42.0")).to.equal(42.0); |
||
| 15 | expect(autoCast("42.42")).to.equal(42.42); |
||
| 16 | }) |
||
| 17 | |||
| 18 | it('should cast to a boolean', function(){ |
||
| 19 | expect(autoCast("true")).to.be.true; |
||
|
|
|||
| 20 | expect(autoCast("True")).to.be.true; |
||
| 21 | |||
| 22 | expect(autoCast("false")).to.be.false; |
||
| 23 | expect(autoCast("False")).to.be.false; |
||
| 24 | }) |
||
| 25 | |||
| 26 | it('should return a string if no other type matches', function(){ |
||
| 27 | expect(autoCast('icls')).to.equal('icls'); |
||
| 28 | }) |
||
| 29 | }); |
||
| 30 | |||
| 32 |