public void InstallNpmPackage_Invokes_Process_Start(
            [Frozen] IProcessLauncher processLauncher,
            NpmInstaller sut,
            string packageName)
        {
            sut.InstallNpmPackage(packageName);

            Mock.Get(processLauncher)
            .Verify(
                c => c.Start(
                    It.IsAny <string>(),
                    $"install -g {packageName}",
                    null));
        }
Esempio n. 2
0
        public static void NpmInstall(this ICakeContext context, NpmInstallSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            AddinInformation.LogVersionInformation(context.Log);
            var installer = new NpmInstaller(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log);

            installer.Install(settings);
        }
Esempio n. 3
0
        protected override void RunTool()
        {
            var tool = new NpmInstaller(FileSystem, Environment, ProcessRunner, Tools, Log);

            tool.Install(Settings);
        }