Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetch() unit test always fail #261

Open
JamiKettunen opened this issue Apr 26, 2022 · 3 comments
Open

fetch() unit test always fail #261

JamiKettunen opened this issue Apr 26, 2022 · 3 comments

Comments

@JamiKettunen
Copy link

In spec/install_spec.sh the fetch() testcase always fails due to http://repo.test/b3d5591.tar.gz not existing. Am I missing something? Currently I'm simply dropping the entire testcase with a patch to make the testsuite pass as a part of creating a package for Void Linux.

@ko1nksm
Copy link
Member

ko1nksm commented Apr 29, 2022

Does the file helper/fixture/install/b3d5591.tar.gz exist? http://repo.test/b3d5591.tar.gz refers to it.

@JamiKettunen
Copy link
Author

It does inside https://github.com/shellspec/shellspec/archive/refs/tags/0.28.1.tar.gz yes (which I'm using as the source for the package), I'll have to get back to this at some point again, just wonder how this file is being served on a seemingly local web server during unit tests

@LukeSavefrogs
Copy link
Contributor

just wonder how this file is being served on a seemingly local web server during unit tests

Actually it is not served on a local web server.

Instead, the curl and wget commands are mocked:

curl() { exit 1; }
wget() { exit 1; }

curl() {
case $* in
*--head*) ;;
*) cat "$FIXTURE/b3d5591.tar.gz"
esac
}

wget() {
case $* in
*--spider*) ;;
*) cat "$FIXTURE/b3d5591.tar.gz"
esac
}

If the error printed by shellspec is Unknown word 'exist' after should verb and the output of the failure is the following...

image

... then this is the same bug as #179. In fact, as you can see by my answer, the error is exactly the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants