Skip to content

Commit

Permalink
Corrects rustcc tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcr committed Oct 18, 2016
1 parent ac3cb93 commit f594dd2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
29 changes: 23 additions & 6 deletions test/unit/cargo-tessel.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ exports['Cargo Subcommand (cargo tessel ...)'] = {
bresolve.then(() => {
test.equal(console.log.callCount, 1);
test.equal(console.log.lastCall.args[0], tarball);
test.deepEqual(this.parse.lastCall.args, [['build']]);
test.deepEqual(this.runBuild.lastCall.args, [ { isCli: false, binary: undefined } ]);
test.deepEqual(this.parse.lastCall.args, [
['build']
]);
test.deepEqual(this.runBuild.lastCall.args, [{
isCli: false,
binary: undefined
}]);
test.done();
});
},
Expand All @@ -46,12 +51,18 @@ exports['Cargo Subcommand (cargo tessel ...)'] = {

this.install = this.sandbox.stub(rust.cargo, 'install').returns(iresolve);

cargo.nomnom.globalOpts({subcommand: 'install'});
cargo.nomnom.globalOpts({
subcommand: 'install'
});
cargo(['sdk', 'install']);

iresolve.then(() => {
test.equal(this.install.callCount, 1);
test.deepEqual(this.install.lastCall.args[0], { '0': 'sdk', subcommand: 'install', _: [ 'sdk', 'install' ] });
test.deepEqual(this.install.lastCall.args[0], {
'0': 'sdk',
subcommand: 'install',
_: ['sdk', 'install']
});
test.done();
});
},
Expand All @@ -62,12 +73,18 @@ exports['Cargo Subcommand (cargo tessel ...)'] = {

this.uninstall = this.sandbox.stub(rust.cargo, 'uninstall').returns(iresolve);

cargo.nomnom.globalOpts({subcommand: 'uninstall'});
cargo.nomnom.globalOpts({
subcommand: 'uninstall'
});
cargo(['sdk', 'uninstall']);

iresolve.then(() => {
test.equal(this.uninstall.callCount, 1);
test.deepEqual(this.uninstall.lastCall.args[0], { '0': 'sdk', subcommand: 'uninstall', _: [ 'sdk', 'uninstall' ] });
test.deepEqual(this.uninstall.lastCall.args[0], {
'0': 'sdk',
subcommand: 'uninstall',
_: ['sdk', 'uninstall']
});
test.done();
});
},
Expand Down
5 changes: 3 additions & 2 deletions test/unit/deployment/rust.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ exports['deploy.rust'] = {
hostname: hostname,
port: port
}),
target: DEPLOY_DIR_RS
target: DEPLOY_DIR_RS,
resolvedEntryPoint: 'charmander',
})
.then(() => {
// Check the options of the call to http
test.equal(this.httpRequest.callCount, 1);
test.equal(this.httpRequest.lastCall.args[0].host, hostname);
test.equal(this.httpRequest.lastCall.args[0].port, port);
test.equal(this.httpRequest.lastCall.args[0].path, '/rust-compile');
test.equal(this.httpRequest.lastCall.args[0].path, '/rust-compile?target=charmander');
test.equal(this.httpRequest.lastCall.args[0].method, 'POST');

// Make sure tar pack was called with the correct target
Expand Down

0 comments on commit f594dd2

Please sign in to comment.