[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste 356e54f 242/298: Tests: Add unit test for webpast
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste 356e54f 242/298: Tests: Add unit test for webpaste--get-shebang-lang-mode |
Date: |
Thu, 9 Dec 2021 19:00:22 -0500 (EST) |
branch: elpa/webpaste
commit 356e54f6ce65d0027a05dbc5fb0b05ee78cf7490
Author: Elis Hirwing <elis@hirwing.se>
Commit: Elis Hirwing <elis@hirwing.se>
Tests: Add unit test for webpaste--get-shebang-lang-mode
---
tests/unit/test-webpaste-get-language.el | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/tests/unit/test-webpaste-get-language.el
b/tests/unit/test-webpaste-get-language.el
new file mode 100644
index 0000000..eb2ee81
--- /dev/null
+++ b/tests/unit/test-webpaste-get-language.el
@@ -0,0 +1,32 @@
+;;; test-webpaste-get-language.el --- Tests for webpaste
+;;; Commentary:
+;;; Code:
+
+(load "tests/load-undercover.el")
+(require 'webpaste)
+
+(describe
+ "Get language for buffer"
+
+ ;; Setup the current buffer with a bash script
+ (before-each
+ (insert "#!/usr/bin/env bash")
+ (newline)
+ (insert "echo 'Hello'"))
+
+ ;; Kill the contents of the current buffers bash script
+ (after-each
+ (kill-region (point-min) (point-max)))
+
+ (it
+ "can get the language by shebang"
+
+ ;; Setup. Let the mode be fundamental-mode.
+ (let ((major-mode 'fundamental-mode))
+ ;; Do test. And expect the matched mode to be bash-mode, since the buffer
+ ;; contains a bash shebang.
+ (expect (webpaste--get-shebang-lang-mode)
+ :to-equal
+ 'bash-mode))))
+
+;;; test-webpaste-get-language.el ends here
- [nongnu] elpa/webpaste 22f64b7 255/298: undercover: Fix up undercover reporting, (continued)
- [nongnu] elpa/webpaste 22f64b7 255/298: undercover: Fix up undercover reporting, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste a8b682a 239/298: Add toml lang to ptpb.pw default, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2c399a0 243/298: Tests: Add unit tests for shebangs to override major-mode, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste a3a9a77 251/298: Remove spaces at end of lines, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7345c5f 252/298: [providers] Deprecation of ptpb.pw as a provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 521de6d 247/298: Update copyright year, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 87ea8b1 294/298: workflows: Remove environment variable to force install cask on macos, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7d8e0d4 287/298: wepaste: Add provider paste.rs, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste a9c4aa4 288/298: Merge branch 'provider-paste-rs', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b47767f 229/298: Prefix integration test names to filter them out easily if they seem, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 356e54f 242/298: Tests: Add unit test for webpaste--get-shebang-lang-mode,
ELPA Syncer <=
- [nongnu] elpa/webpaste b8e9245 230/298: Add helper function to find buffers language for provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste d6a8771 250/298: Merge branch 'vapniks-patch-1', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 8f9322f 265/298: Merge branch 'tastytea-dpaste.de-new-location', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2d0f810 268/298: Merge branch 'condy0919-master', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 141376a 264/298: Change dpaste.de to dpaste.org., ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 1a6c0e9 263/298: Bump version number in file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7a30602 274/298: Bump version number in file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 84b5c80 279/298: readme: Add readme entry for max retries, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 533bb40 290/298: Apply suggestions from code review, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste dacb4fb 289/298: Add support for bpa.st pastebin, ELPA Syncer, 2021/12/09