public async Task BashCompletionInstaller_ShouldUseNixLineEndings()
        {
            if (ExecutionEnvironment.IsRunningOnMac || ExecutionEnvironment.IsRunningOnNix)
            {
                var bashInstaller = new BashCompletionInstaller(commandOutputProvider, fileSystem);
                await installAutoCompleteCommand.Execute(new[]
                                                         { $"--shell={bashInstaller.SupportedShell.ToString()}", "--dryRun" });

                commandOutputProvider.Received().Information(Arg.Is <string>(arg =>
                                                                             arg.Contains(bashInstaller.ProfileScript.NormalizeNewLinesForNix())));
            }
            else
            {
                Assert.Inconclusive("This test doesn't run on windows environments.");
            }
        }
Ejemplo n.º 2
0
        static IEnumerable <ShellCompletionInstaller> GetShellCompletionInstallers()
        {
            var zshCompletionInstaller        = new ZshCompletionInstaller(commandOutputProvider, fileSystem);
            var pwshCompletionInstaller       = new PwshCompletionInstaller(commandOutputProvider, fileSystem);
            var bashCompletionInstaller       = new BashCompletionInstaller(commandOutputProvider, fileSystem);
            var powershellCompletionInstaller = new PowershellCompletionInstaller(commandOutputProvider, fileSystem);

            var installers = new List <ShellCompletionInstaller>
            {
                zshCompletionInstaller, bashCompletionInstaller, pwshCompletionInstaller
            };

            if (ExecutionEnvironment.IsRunningOnWindows)
            {
                installers.Add(powershellCompletionInstaller);
            }

            return(installers);
        }