Skip to content

not sure how to source another file #37

@binaryphile

Description

@binaryphile

None of the examples show how to source a file into the test file, say for testing a set of functions.

I tried simply using "source ../lib/functions.sh" at the start of the test script, but got "/usr/local/bin/roundup: 3: ./functions-test.sh: source: not found".

Changing the line to ". ../lib/functions.sh" got further, but errored with:

". ../lib/functions.sh

  • function myfunc {
    /usr/local/bin/roundup: 3: ../lib/functions.sh: function: not found"

I also tried adding both of these to a before() call, but neither worked.

How are you supposed to source functions for testing when they're defined in other files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions