Left: | ||
Right: |
OLD | NEW |
---|---|
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 describe('charm normalization', function() { | 3 describe('charm normalization', function() { |
4 var models; | 4 var models; |
5 | 5 |
6 before(function(done) { | 6 before(function(done) { |
7 YUI(GlobalConfig).use('juju-models', 'juju-charm-models', function(Y) { | 7 YUI(GlobalConfig).use('juju-models', 'juju-charm-models', function(Y) { |
8 models = Y.namespace('juju.models'); | 8 models = Y.namespace('juju.models'); |
9 done(); | 9 done(); |
10 }); | 10 }); |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
534 charm.load( | 534 charm.load( |
535 charm_store, | 535 charm_store, |
536 function(err, data) { | 536 function(err, data) { |
537 if (!err) { | 537 if (!err) { |
538 assert.fail('should fail!'); | 538 assert.fail('should fail!'); |
539 } | 539 } |
540 done(); | 540 done(); |
541 }); | 541 }); |
542 }); | 542 }); |
543 }); | 543 }); |
544 | |
545 | |
546 describe('browser charm', function() { | |
547 var instance, models; | |
548 | |
549 before(function(done) { | |
550 YUI(GlobalConfig).use('juju-models', 'juju-charm-models', function(Y) { | |
551 models = Y.namespace('juju.models'); | |
552 done(); | |
553 }); | |
554 }); | |
555 | |
556 after(function(done) { | |
jeff.pihach
2013/04/02 18:14:36
It looks to me like this should actually be afterE
rharding
2013/04/02 18:29:21
Correct, thanks!
| |
557 instance.destroy(); | |
558 done(); | |
559 }); | |
560 | |
561 it('creates a config attribute from the options', function() { | |
562 var sample_options = { | |
563 'client-port': { | |
564 'default': 9160, | |
565 'description': 'Port for client communcation', | |
566 'type': 'int' | |
567 }, | |
568 'cluster-name': { | |
569 'default': 'Test Cluster', | |
570 'description': 'Name of the Cassandra Cluster - do not change yet!', | |
571 'type': 'string' | |
572 } | |
573 }; | |
574 | |
575 instance = new models.BrowserCharm({ | |
576 id: 'precise/cassandra-1', | |
577 options: sample_options | |
578 }); | |
579 | |
580 var config = instance.get('config'); | |
581 config[0].name.should.eql('client-port'); | |
582 config[0].type.should.eql('int'); | |
583 config[1].name.should.eql('cluster-name'); | |
584 }); | |
585 | |
586 it('config should be undefined if there are no options.', function() { | |
587 instance = new models.BrowserCharm({ | |
588 id: 'precise/cassandra-1' | |
589 }); | |
590 | |
591 assert(instance.get('config') === undefined); | |
592 }); | |
593 | |
594 }); | |
OLD | NEW |