- (require 'yasnippet)
- (yas-global-mode)
- (switch-to-buffer "foo.c")
- (c-mode)
- (insert "#include <iostream>\nmain")
- (setq yas-good-grace nil)
- (yas-expand)
- (kill-emacs 0))
+ (require 'yasnippet-tests)
+ (yas-with-snippet-dirs
+ '((".emacs.d/snippets"
+ ("c-mode"
+ ("main" . "int main ()"))))
+ (yas-global-mode)
+ (switch-to-buffer "foo.c")
+ (c-mode)
+ (insert "#include <iostream>\nmain")
+ (setq yas-good-grace nil)
+ (yas-expand)
+ (should (string= (buffer-string)
+ "#include <iostream>\nint main ()"))
+ (kill-emacs 0)))