22
33var Promise = require ( 'ember-cli/lib/ext/promise' ) ;
44var assert = require ( 'ember-cli/tests/helpers/assert' ) ;
5+ var CoreObject = require ( 'core-object' ) ;
56
67var stubProject = {
78 name : function ( ) {
@@ -53,7 +54,8 @@ describe('redis plugin', function() {
5354 config : {
5455 redis : {
5556 host : 'somehost' ,
56- port : 1234
57+ port : 1234 ,
58+ database : 4
5759 }
5860 }
5961 } ;
@@ -62,6 +64,37 @@ describe('redis plugin', function() {
6264 assert . ok ( true ) ; // didn't throw an error
6365 } ) ;
6466
67+ it ( 'passes through config options' , function ( ) {
68+ var plugin = subject . createDeployPlugin ( {
69+ name : 'redis'
70+ } ) ;
71+
72+ var redisDeployClientClassInitialised = false ;
73+ var context = {
74+ ui : mockUi ,
75+ project : stubProject ,
76+ config : {
77+ redis : {
78+ host : 'somehost' ,
79+ port : 1234 ,
80+ database : 4
81+ }
82+ } ,
83+ redisDeployClientClass : CoreObject . extend ( {
84+ init : function ( options ) {
85+ assert . equal ( options . host , 'somehost' ) ;
86+ assert . equal ( options . port , 1234 ) ;
87+ assert . equal ( options . database , 4 ) ;
88+ redisDeployClientClassInitialised = true ;
89+ }
90+ } )
91+ } ;
92+ plugin . beforeHook ( context ) ;
93+ plugin . configure ( context ) ;
94+ plugin . readConfig ( "redisDeployClient" ) ;
95+ assert . ok ( redisDeployClientClassInitialised ) ;
96+ } ) ;
97+
6598 describe ( 'resolving revisionKey from the pipeline' , function ( ) {
6699 it ( 'uses the config data if it already exists' , function ( ) {
67100 var plugin = subject . createDeployPlugin ( {
0 commit comments