summaryrefslogtreecommitdiff
path: root/test/command_callback/test_cucumber_command_callback.vader
diff options
context:
space:
mode:
authorEddie Lebow <elebow@users.noreply.github.com>2018-04-17 00:29:13 -0400
committerEddie Lebow <elebow@users.noreply.github.com>2018-04-20 22:54:29 -0400
commit1e6651e0a0039185d63ebe4f26f04937e82207fb (patch)
tree03eb2190fb4eed1c7a2cfc73cc7080e885fc963f /test/command_callback/test_cucumber_command_callback.vader
parentfb720251bf38139c1811665852e1bc2f73d0393f (diff)
downloadale-1e6651e0a0039185d63ebe4f26f04937e82207fb.zip
Add cucumber checker for cucumber files
For now, it only detects undefined steps. The nearest `features` dir above the buffer file is loaded, so step definitions should be found correctly. Tested only with Cucumber for Ruby, but it should work for any cucumber that follows a substantially similar directory structure.
Diffstat (limited to 'test/command_callback/test_cucumber_command_callback.vader')
-rw-r--r--test/command_callback/test_cucumber_command_callback.vader25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/command_callback/test_cucumber_command_callback.vader b/test/command_callback/test_cucumber_command_callback.vader
new file mode 100644
index 00000000..d09a5712
--- /dev/null
+++ b/test/command_callback/test_cucumber_command_callback.vader
@@ -0,0 +1,25 @@
+Before:
+ runtime ale_linters/ruby/rubocop.vim
+ call ale#test#SetDirectory('/testplugin/test/')
+
+After:
+ Restore
+
+ call ale#linter#Reset()
+ call ale#test#RestoreDirectory()
+
+Execute(Should require the nearest features dir, if one is found):
+ call ale#test#SetFilename('cucumber_fixtures/features/cuke.feature')
+
+ AssertEqual
+ \ 'cucumber --dry-run --quiet --strict --format=json '
+ \ . '-r ' . ale#Escape(ale#path#Simplify(g:dir . '/cucumber_fixtures/features/')) . ' %t',
+ \ ale_linters#cucumber#cucumber#GetCommand(bufnr(''))
+
+Execute(Should require nothing if no features dir is found):
+ call ale#test#SetFilename('something/without/a/features/dir')
+
+ AssertEqual
+ \ 'cucumber --dry-run --quiet --strict --format=json '
+ \ . ' %t',
+ \ ale_linters#cucumber#cucumber#GetCommand(bufnr(''))