Skip to content
TheChatArchiveThe Chat Archive
Coherecommand-a-03-2025· CohereHugging Face LMArena Human Preference 140K

Unresolved directive in Mock vs Stub vs Spy.adoc - include::"What is mock.adoc"[]

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with chatgpt-4o-latest-20250326’s answer.
  1. User

    Unresolved directive in Mock vs Stub vs Spy.adoc - include::"What is mock.adoc"[]

  2. Cohere Assistant

    The error message "Unresolved directive" typically means that Asciidoctor cannot find the file you're trying to include. Here's a step-by-step guide to troubleshoot and fix this issue:


    1. Verify the File Exists

    Ensure the file "What is mock.adoc" exists in the correct location.

    Example Directory Structure:

    docs/
    ├── Mock vs Stub vs Spy.adoc
    └── What is mock.adoc
    

    Incorrect Path Example: If the file is actually named what-is-mock.adoc (without spaces), use:

    include::what-is-mock.adoc[]
    

    Correct Path with Spaces: If the file is indeed "What is mock.adoc", ensure the include directive uses quotes:

    include::"What is mock.adoc"[]
    

    2. Check File Permissions

    Ensure the file is readable by the user running the Asciidoctor process.


    3. Verify Relative Paths

    AsciiDoc includes are relative to the current document's location, not the project root.

    Example: If Mock vs Stub vs Spy.adoc is in a subdirectory:

    docs/
    └── concepts/
        ├── Mock vs Stub vs Spy.adoc
        └── What is mock.adoc
    

    The include should be:

    include::What is mock.adoc[]
    

    If What is mock.adoc is in a parent directory:

    docs/
    ├── What is mock.adoc
    └── concepts/
        └── Mock vs Stub vs Spy.adoc
    

    Use:

    include::../What is mock.adoc[]
    

    4. Check for Hidden Characters

    Sometimes filenames contain invisible characters. Verify the filename is exactly as expected:

    • On macOS: Use ls -lO to check for hidden flags.
    • On Linux: Use ls -l and check for unusual characters.
    • On Windows: Use PowerShell's Get-ChildItem -Force to list all files.

    5. Test with Absolute Paths

    As a temporary test, use an absolute path to confirm the file is accessible:

    include::/full/path/to/docs/What is mock.adoc[]
    

    Note: Avoid using absolute paths in production, as they break portability.


    6. Check Asciidoctor Version

    Ensure you're using a modern version of Asciidoctor (>= 2.0). Older versions might handle includes differently.

    Check Version:

    asciidoctor --version
    

    Update Asciidoctor:

    # For Ruby
    gem update asciidoctor
    
    # For npm
    npm install -g asciidoctor.js
    
    # For Python
    pip install asciidoctor
    

    7. Debugging Tips

    Enable Debug Output:

    Run Asciidoctor with the -v (verbose) flag:

    asciidoctor -v Mock vs Stub vs Spy.adoc
    

    This will show detailed information about include processing.

    Check for Typos:

    Ensure there are no typos in the filename or path. Filenames are case-sensitive on Linux/macOS.


    8. Example Fix

    Assuming the correct structure:

    docs/
    ├── Mock vs Stub vs Spy.adoc
    └── What is mock.adoc
    

    Correct Include:

    = Mock vs Stub vs Spy
    
    include::"What is mock.adoc"[]
    

    If in a subdirectory:

    docs/
    └── testing/
        ├── Mock vs Stub vs Spy.adoc
        └── What is mock.adoc
    

    Correct Include:

    include::What is mock.adoc[]
    

    9. Alternative: Use Attributes for Paths

    If you have many includes, define a path attribute:

    :definitions-dir: ./
    
    include::{definitions-dir}What is mock.adoc[]
    

    10. Common Mistakes

    MistakeCorrect
    include::What is mock.adoc[] (no quotes)include::"What is mock.adoc"[]
    include::./What is mock.adoc[] (unnecessary ./)include::"What is mock.adoc"[]
    include::../What is mock.adoc[] (wrong relative path)Check actual directory structure

    Final Checklist

    1. Is the file in the correct directory?
    2. Are quotes used around the filename?
    3. Is the path relative to the current document?
    4. Are there hidden characters in the filename?
    5. Is the file readable by the user?
    6. Is Asciidoctor up to date?

    If all else fails, temporarily rename the file to remove spaces (e.g., what-is-mock.adoc) to confirm the include mechanism is working. Once confirmed, restore the original filename and ensure quotes are used.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.