shellspec icon indicating copy to clipboard operation
shellspec copied to clipboard

fetch() unit test always fail

Open JamiKettunen opened this issue 3 years ago • 3 comments

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.

JamiKettunen avatar Apr 26 '22 21:04 JamiKettunen

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

ko1nksm avatar Apr 29 '22 03:04 ko1nksm

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

JamiKettunen avatar May 25 '22 11:05 JamiKettunen

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: https://github.com/shellspec/shellspec/blob/90e48c950239f3b8a9fdfa3e869592872c77b981/spec/install_spec.sh#L114-L115 https://github.com/shellspec/shellspec/blob/90e48c950239f3b8a9fdfa3e869592872c77b981/spec/install_spec.sh#L124-L129 https://github.com/shellspec/shellspec/blob/90e48c950239f3b8a9fdfa3e869592872c77b981/spec/install_spec.sh#L140-L145

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.

LukeSavefrogs avatar Nov 13 '22 23:11 LukeSavefrogs