Skip to content

Commands generated by AllFailingTestsClipboardReporter only works on Windows #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
claremacrae opened this issue Mar 5, 2021 · 5 comments
Labels
Milestone

Comments

@claremacrae
Copy link
Contributor

Steps to reproduce:

On Mac or Linux...

  1. Add this to your ApprovalTests.Config.cs:
    [assembly: UseReporter(typeof(AllFailingTestsClipboardReporter))]
  2. Make some approval tests fail
  3. Paste the clipboard on to a console window...

Expected behaviour:
*.approved.* are updated, for the failing tests

Actual behaviour:
a bunch of errors command not found: cmd

This looks to be the cause:

return $"cmd /c move /Y \"{received}\" \"{approved}\"";

@claremacrae
Copy link
Contributor Author

I see this was already logged in #437 - this ticket answers the question there about what the problem was, I think.

@claremacrae
Copy link
Contributor Author

The simplest fix would be to change cmd /c move /Y to cp if not on Windows...

There are complications if the user has aliased cp to cp -i - to force a prompt, but I'd prefer to start with a solution that works for many users, than wait for a perfect one!

Or - having read the following - use \cp instead, which will bypass any alias (and has been in my muscle memory for \rm for many years, so I know it works well...

https://unix.stackexchange.com/a/146442/186988

@SimonCropp SimonCropp added this to the 5.4.6 milestone Mar 6, 2021
@SimonCropp SimonCropp added the bug label Mar 6, 2021
@SimonCropp
Copy link
Contributor

@claremacrae can u try 5.4.6

@claremacrae
Copy link
Contributor Author

@claremacrae can u try 5.4.6

Perfect - thanks @SimonCropp !

@claremacrae
Copy link
Contributor Author

@SimonCropp the only weird thing is that this doesn't show up in the releases page which thinks that 5.4.4 was the last release....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants