junegunn / junegunn/vader.vim

Can Vader test if new file is opened properly?

Open
#219 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
599
Forks
40
PR merge metrics
No merged PRs in 30d

Description

I am writing a plugin which should allow opening files by hitting return on them similar to what [Fugitive](https://github.com/tpope/vim-fugitive/) does. Is this a testable scenario?

I wrote [some tests for Fugitive](https://github.com/srasku/vim-fugitive/commit/9283bf69d6aa71b5a8b1156a8729f17918ec61d6) but [the one to test opening a file](https://github.com/srasku/vim-fugitive/commit/9283bf69d6aa71b5a8b1156a8729f17918ec61d6) doesn't work. It works if I test it manually. Am I doing something wrong?

Note that the contents I am expecting won't match but I'm getting no contents at all. This is my Vader output.

```
Starting Vader: 1 suite(s), 7 case(s)
Starting Vader: /Users/Stephen/.vim/bundle/vim-fugitive/test/fugitive-Gstatus.vader
(1/7) [EXECUTE] Git on unmodified repo
(1/7) [ EXPECT] empty file
(2/7) [EXECUTE] Git with added file
> Check that foo exists
(2/7) [ EXPECT] added file
(3/7) [EXECUTE] Git with removed file
(3/7) [ EXPECT] removed file
(4/7) [EXECUTE] Git with missing file
(4/7) [ EXPECT] missing file
(5/7) [EXECUTE] Git with untracked file
(5/7) [ EXPECT] untracked file
(6/7) [ DO] select foo
(6/7) [ THEN] foo opens
> Filetype should not be "fugitive"
(6/7) [ THEN] (X) '[Vader-workbench]' should be equal to 'foo'
(6/7) [ EXPECT] (X) foo contents
- Expected:
foo should not be empty
- Got:

(7/7) [EXECUTE] cleanup
(7/7) [ THEN] directory has been removed
> Checking whether vader-clone directory has been deleted.
Success/Total: 6/7
Success/Total: 6/7 (assertions: 10/11)
Elapsed time: 1.755594 sec.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.