SwiftyMocky: ShellOut encountered an error

1.8k views Asked by At

I am facing below issue while generating mock with SwiftyMocky

╔════════════════════════╗
║ SwiftyMocky CLI v3.5.0 ║
╚════════════════════════╝

Running at: <path-to-project>SomeProject
Processing mock: SomeTests ...
❌  Error: ShellOut encountered an error
Status code: 1
Message: "Unknown Arguments: <path>/.mocky/.config.yml.tmp

Options:
    --watch [default: false] - Watch template for changes and regenerate as needed.
    --disableCache [default: false] - Stops using cache.
    --verbose [default: false] - Turn on verbose logging
    --quiet [default: false] - Turn off any logging, only emmit errors.
    --prune [default: false] - Remove empty generated files
    --sources - Path to a source swift files. File or Directory.
    --exclude-sources - Path to a source swift files to exclude. File or Directory.
    --templates - Path to templates. File or Directory.
    --exclude-templates - Path to templates to exclude. File or Directory.
    --output - Path to output. File or Directory. Default is current path.
    --config - Path to config file. File or Directory. Default is current path.
    --force-parse - File extensions that Sourcery will be forced to parse, even if they were generated by Sourcery.
    --args - Custom values to pass to templates.
    --ejsPath - Path to EJS file for JavaScript templates."
Output: ""

I have tried Updating sourcery version to 0.18.0 and Uninstalling both sourcery and SwiftyMocky and reinstalling.

Any help would be appreciated.

Updated SwiftyMocky doctor logs

✗ SwiftyMocky doctor
╔════════════════════════╗
║ SwiftyMocky CLI v3.5.0 ║
╚════════════════════════╝


1. Inspecting tools dependencies:
  ✅  Mint available
  ✅  Sourcery is available through Mint

2. Inspecting Mockfile:
  ✅  Mockfile exists
  ✅  Mockfile contains mocks definitions

3. Linting 'ServicingTests' mock:
  ✅  Output file exists
  Targets:
  ✅  Mock defines targets correctly
  ✅  All targets include 
'./<project>/ServicingTests/ServicingTests.Mock.generated.swift' file.
  Sources:
  ✅  Sources are defined correctly
  Imports:
  ✅  Testable imports are defined
  ✅  Imports are defined

Moreover, one of my colleagues is able to generate mock. He says that when he runs the SwiftyMocky generate command it doesn't generate <path>/.mocky/.config.yml.tmp.

The only difference is macOS version. I am running 10.15.4 whereas he is running 10.15.3.

1

There are 1 answers

2
Ankur Arya On BEST ANSWER

I solved the problem finally, it was a silly thing. I had a space in the project path. All I needed was to remove that space from the project path and it worked like a charm.