Ver Fonte

Tests: add session.vader

Marco Hinz há 10 anos atrás
pai
commit
1c1c3abb80

+ 1 - 1
autoload/startify.vim

@@ -756,7 +756,7 @@ endfunction
 function! s:create_last_session_link(spath)
   if !has('win32') && a:spath !~# '__LAST__$'
     let cmd = printf('ln -sf %s %s',
-          \ shellescape(a:spath),
+          \ shellescape(fnamemodify(a:spath, ':t')),
           \ shellescape(s:session_dir .'/__LAST__'))
     silent! call system(cmd)
     if v:shell_error

+ 1 - 1
test/feature/buffer.vader

@@ -1,7 +1,7 @@
 Before:
   Startify
 
-Execute (Check set options):
+Execute (Check buffer options):
   AssertEqual 'startify', &filetype
   AssertEqual 'wipe',     &bufhidden
   AssertEqual 'nofile',   &buftype

+ 0 - 0
test/feature/mappings.vader → test/feature/mapping.vader


+ 18 - 0
test/feature/session.vader

@@ -0,0 +1,18 @@
+Execute (Session: :SSave foo):
+  edit include/testfile.txt
+  SSave foo
+  SClose
+Do:
+  e
+Expect:
+  
+Execute (Session: :SLoad foo):
+  silent SLoad foo
+Expect:
+  This is just a simple test file.
+  Foo, bar, quux.
+
+Execute (Session: :SDelete foo):
+  Assert 1 == filereadable(g:startify_session_dir.'/foo')
+  SDelete foo
+  Assert 0 == filereadable(g:startify_session_dir.'/foo')

+ 2 - 0
test/include/testfile.txt

@@ -0,0 +1,2 @@
+This is just a simple test file.
+Foo, bar, quux.

+ 2 - 1
test/vader.vader

@@ -2,4 +2,5 @@ Execute (:Startify command available):
   Assert 2 == exists(':Startify')
 
 Include: feature/buffer.vader
-Include: feature/mappings.vader
+Include: feature/mapping.vader
+Include: feature/session.vader

+ 3 - 0
test/vimrc

@@ -4,3 +4,6 @@ set runtimepath+=..
 filetype plugin on
 syntax enable
 set hidden
+set sessionoptions-=tabpages
+let g:startify_session_dir = 'include'
+let g:startify_relative_path = 1