Dont prioritze rust-toolchain file over input variable (#45)

This commit is contained in:
Thomas Eizinger 2020-01-17 23:21:07 +11:00 committed by svartalf
parent 6a1db6369e
commit d8323be6bd
5 changed files with 41 additions and 15 deletions

View file

@ -40,6 +40,16 @@ describe('actions-rs/toolchain', () => {
'INPUT_TOOLCHAIN': 'nightly',
});
expect(args.name).toBe("nightly")
});
it('uses rust-toolchain file if input does not exist', function () {
let rustToolchainFile = tempWriteSync("1.39.0");
let args = morph(() => {
return toolchain_args(rustToolchainFile);
}, {});
expect(args.name).toBe("1.39.0")
});
@ -48,9 +58,7 @@ describe('actions-rs/toolchain', () => {
let args = morph(() => {
return toolchain_args(rustToolchainFile);
}, {
'INPUT_TOOLCHAIN': 'nightly',
});
}, {});
expect(args.name).toBe("1.39.0")
});