Skip to content

Commit aedf446

Browse files
committed
use new setup/teardown hooks
1 parent 1c93fc3 commit aedf446

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232

3333
requiredConfig: ['host', 'username'],
3434

35-
willDeploy: function(/* context */) {
35+
setup: function(/* context */) {
3636
var srcPort = this.readConfig('srcPort');
3737

3838
if (srcPort > MAX_PORT_NUMBER || srcPort < MIN_PORT_NUMBER) {
@@ -69,7 +69,7 @@ module.exports = {
6969
});
7070
},
7171

72-
didDeploy: function(context) {
72+
teardown: function(context) {
7373
context.tunnel.handler.close();
7474
}
7575
});

tests/unit/index-nodetest.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ describe('ssh-tunnel plugin', function() {
3434

3535
assert.equal(typeof result.defaultConfig, 'object');
3636
assert.equal(typeof result.requiredConfig, 'object');
37-
assert.equal(typeof result.willDeploy, 'function');
38-
assert.equal(typeof result.didDeploy, 'function');
37+
assert.equal(typeof result.setup, 'function');
38+
assert.equal(typeof result.teardown, 'function');
3939
});
4040

4141
describe('configure hook', function() {
@@ -131,7 +131,7 @@ previous.push(current);
131131
});
132132
});
133133

134-
describe('willDeploy hook', function() {
134+
describe('setup hook', function() {
135135
var plugin;
136136
var context;
137137

@@ -163,7 +163,7 @@ previous.push(current);
163163
});
164164

165165
it('returns the updated context if tunnel is successful', function(done) {
166-
assert.isFulfilled(plugin.willDeploy(context)).then(function(result) {
166+
assert.isFulfilled(plugin.setup(context)).then(function(result) {
167167
assert.isDefined(result.tunnel.handler);
168168
assert.isDefined(result.tunnel.srcPort);
169169
done();
@@ -173,7 +173,7 @@ previous.push(current);
173173
});
174174
});
175175

176-
describe('didDeploy hook', function() {
176+
describe('teardown hook', function() {
177177
var plugin;
178178
var context;
179179

@@ -202,7 +202,7 @@ previous.push(current);
202202
}
203203
};
204204

205-
var result = plugin.didDeploy(context);
205+
var result = plugin.teardown(context);
206206
});
207207
});
208208
});

0 commit comments

Comments
 (0)