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

Migrating from V1 to V2 #38

Closed
jorgebucaran opened this issue Feb 7, 2019 · 0 comments
Closed

Migrating from V1 to V2 #38

jorgebucaran opened this issue Feb 7, 2019 · 0 comments
Labels
meta Announcements, migration guides, news

Comments

@jorgebucaran
Copy link
Owner

jorgebucaran commented Feb 7, 2019

Just upgraded to V2? You'll need to make some adjustments. In this issue, I'll explain what these changes are and how to migrate your tests. 🙌

Background

Fishtape V1 test syntax wasn't valid Fish syntax. Running fishtape test.fish transformed test blocks to valid to test builtin declarations under the hood.

That means you couldn't use fish_indent to format your files. Blocks didn't let you create multiple assertions either, defeating the purpose of a "block" in the first place. Even if you never used fish_indent, why write pseudo-Fish code when you can write real Fish?

What's new?

V2 introduces a new @test function. It wraps the test builtin, so you can specify an optional description for your test. Another small difference is no support for -o or -a operators.

Here are some examples:

@test "current directory is home" $PWD = $HOME

@test "hello has length 5" (string length "hello") = 5

@test "math still works" 42 -eq (math 41 + 1)

@test "test is a builtin" (contains -- test (builtin -n)) $status -eq 0

Also new is the @mesg function. It creates a TAP comment like # my message that will be written together with the TAP output.

Other changes include the removal of all special variables, leaving only $current_filename. If we need more variables, we can always add them later when the need arises.

@jorgebucaran jorgebucaran added the meta Announcements, migration guides, news label Feb 7, 2019
@jorgebucaran jorgebucaran pinned this issue Feb 7, 2019
dideler added a commit to dideler/fish-cd-git that referenced this issue Feb 23, 2019
jorgebucaran/fishtape#38

Note that the --local scope of setup vars was removed because it was
no longer working with function's -S/--no-scope-shadowing option. Which
was causing teardown to fail.
@jorgebucaran jorgebucaran unpinned this issue Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Announcements, migration guides, news
Projects
None yet
Development

No branches or pull requests

1 participant