def METHOD_NAME(tmpfolder):
    # Given an executable exists in a path with spaces
    prefix = Path(tmpfolder, "with spaces")
    if os.name == "posix":
        executable = Path(prefix, "bin", "myexec")
        executable.parent.mkdir(parents=True, exist_ok=True)
        executable.write_text("#!/bin/sh\n\necho 42")
        executable.chmod(stat.S_IMODE(stat.S_IREAD | stat.S_IEXEC))
    elif os.name == "nt":  # Windows
        executable = Path(prefix, "Script", "myexec.bat")
        executable.parent.mkdir(parents=True, exist_ok=True)
        executable.write_text("@echo off\r\necho 42", encoding="ascii")
        # ^  Let's use a basic encoding + CRLF for windows
    else:
        pytest.skip("Requires either POSIX-compliant OS or Windows")
        return
    # ----> helps when debugging
    exec_path = shell.get_executable("myexec", prefix=prefix, include_path=False)
    print("exec_path:", pformat(shlex.quote(exec_path)))
    print("contents:\n", pformat(executable.read_text()))
    assert exec_path is not None
    assert Path(exec_path).exists()
    # <----
    # When we create a command with `get_command`
    cmd = shell.get_command("myexec", prefix=prefix, include_path=False)
    assert cmd is not None
    # it should run without any problems
    completed = cmd.run()
    print("stdout:", completed.stdout)
    assert int(completed.stdout) == 42
    completed.check_returncode()