123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- // Generated by CoffeeScript 1.6.3
- var objectToSaneObject;
- require('./_prepare');
- objectToSaneObject = mod('objectToSaneObject');
- describe("sanitize()");
- test("case: 'text'", function() {
- var expectation, input, ret;
- input = 'text';
- expectation = ['text'];
- ret = objectToSaneObject.sanitize(input);
- return ret.should.be.like(expectation);
- });
- test("case: ['text']", function() {
- var expectation, input, ret;
- input = ['text'];
- expectation = ['text'];
- ret = objectToSaneObject.sanitize(input);
- return ret.should.be.like(expectation);
- });
- test("case: {a:b}", function() {
- var expectation, input, ret;
- input = {
- a: 'b'
- };
- expectation = [
- {
- a: ['b']
- }
- ];
- ret = objectToSaneObject.sanitize(input);
- return ret.should.be.like(expectation);
- });
- test("case: {a:[b: 'c']}", function() {
- var expectation, input, ret;
- input = {
- a: [
- {
- b: 'c'
- }
- ]
- };
- expectation = [
- {
- a: [
- {
- b: ['c']
- }
- ]
- }
- ];
- ret = objectToSaneObject.sanitize(input);
- return ret.should.be.like(expectation);
- });
- test("case: {a:b: 'c'}", function() {
- var expectation, input, ret;
- input = {
- a: {
- b: 'c'
- }
- };
- expectation = [
- {
- a: [
- {
- b: ['c']
- }
- ]
- }
- ];
- ret = objectToSaneObject.sanitize(input);
- return ret.should.be.like(expectation);
- });
- test("case: {a:b: ['c', d: 'e']}", function() {
- var expectation, input, ret;
- input = {
- a: {
- b: [
- 'c', {
- d: 'e'
- }
- ]
- }
- };
- expectation = [
- {
- a: [
- {
- b: [
- 'c', {
- d: ['e']
- }
- ]
- }
- ]
- }
- ];
- ret = objectToSaneObject.sanitize(input);
- return ret.should.be.like(expectation);
- });
|