Skip to content

Using Parameters:dynamic with --execdir may fails #203

Description

@ko1nksm

The current directory during translated is not correct.

$ shellspec --execdir @basedir "**/spec"
Running: /bin/sh [sh]
...

Finished in 0.18 seconds (user 0.03 seconds, sys 0.12 seconds)
3 examples, 0 failures, -2 examples did not run (unexpected exit?)


Failure examples / Errors: (Listed here affect your suite's status)

shellspec sub/spec/sub_spec.sh # expected 1 examples, but only ran 3 examples
$ tree -a
.
├── .shellspec
├── spec
│   └── spec_helper.sh
└── sub
    ├── .shellspec
    ├── fixtures
    │   ├── file1.txt
    │   ├── file2.txt
    │   └── file3.txt
    └── spec
        ├── spec_helper.sh
        └── sub_spec.sh
# sub/spec/sub_spec.sh
Parameters:dynamic
  pwd > /dev/tty
  # => "/tmp/shellspec/issue" (During the translation, incorrect)
  # => "/tmp/shellspec/issue/sub" (During the test)

  for file in fixtures/*; do
    %data "$file"
  done
End

Example "File test: $1"
  The file "$1" should be exist
End

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    WORKINGWork in progressbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions