From 5ea266270db1c69b847d7d6b115b2817e5ad235b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 7 Jan 2020 17:17:35 -0800 Subject: Add auto-insert template for bats-mode --- test/integration/oni-bats.bats | 9 +++++++++ test/oni-bats-test.el | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100755 test/integration/oni-bats.bats create mode 100644 test/oni-bats-test.el (limited to 'test') diff --git a/test/integration/oni-bats.bats b/test/integration/oni-bats.bats new file mode 100755 index 0000000..fa5a513 --- /dev/null +++ b/test/integration/oni-bats.bats @@ -0,0 +1,9 @@ +#!/usr/bin/env bats + +@test "Loading a bats file loads oni-bats" { + run emacs -batch -l package -f package-initialize \ + -visit test.bats \ + -eval "(prin1 (featurep 'oni-bats))" + + [[ "$output" == *"t" ]] +} diff --git a/test/oni-bats-test.el b/test/oni-bats-test.el new file mode 100644 index 0000000..7414dc4 --- /dev/null +++ b/test/oni-bats-test.el @@ -0,0 +1,7 @@ +(ert-deftest oni-bats-test-auto-insert () + "Test that ‘auto-insert’ inserts the proper interpreter." + (with-temp-buffer + (bats-mode) + (let ((auto-insert-query nil)) + (auto-insert)) + (should (string= "#!/usr/bin/env bats\n\n" (buffer-string))))) -- cgit v1.3-2-g0d8e