[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup c032c8f 141/340: Exec code blocks in markdown la
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup c032c8f 141/340: Exec code blocks in markdown labeled as "emacs-lisp" and "elisp" |
Date: |
Thu, 16 Dec 2021 14:59:21 -0500 (EST) |
branch: elpa/buttercup
commit c032c8fbc8f74bfb54e0e16e93302ed9fa0e8f48
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Jorgen Schäfer <Jorgen.Schaefer@gmail.com>
Exec code blocks in markdown labeled as "emacs-lisp" and "elisp"
Markdown mode's "markdown-edit-code-block" command automatically uses
"emacs-lisp-mode" for the code block if the type is "emacs-lisp" or
"elisp", so those should be supported.
---
buttercup.el | 6 ++++--
docs/writing-tests.md | 34 +++++++++++++++++-----------------
2 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index 570c63a..0e76e02 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -800,8 +800,10 @@ current directory."
(dolist (file command-line-args-left)
(with-current-buffer (find-file-noselect file)
(goto-char (point-min))
- (while (re-search-forward "```lisp\n\\(\\(?:.\\|\n\\)*?\\)```"
- nil t)
+ (while (let ((case-fold-search t))
+ (re-search-forward
+ "```\\(?:emacs-\\|e\\)?lisp\n\\(\\(?:.\\|\n\\)*?\\)```"
+ nil t))
(let ((code (match-string 1)))
(with-current-buffer lisp-buffer
(insert code))))))
diff --git a/docs/writing-tests.md b/docs/writing-tests.md
index 2bb5dbc..23f8c59 100644
--- a/docs/writing-tests.md
+++ b/docs/writing-tests.md
@@ -19,7 +19,7 @@ A test suite begins with a call to the Buttercup macro
`describe` with
the first parameter describing the suite and the rest being the body
of code that implements the suite.
-```Lisp
+```Emacs-Lisp
(describe "A suite"
(it "contains a spec with an expectation"
(expect t :to-be t)))
@@ -42,7 +42,7 @@ functions internally, so they can contain any executable code
necessary to implement the rules. Emacs Lisp scoping rules apply, so
make sure to define your spec file to be lexically scoped.
-```Lisp
+```Emacs-Lisp
(describe "A suite is just a function"
:var (a)
(it "and so is a spec"
@@ -69,7 +69,7 @@ the spec.
Any matcher can evaluate to a negative assertion by prepending it with
the `:not` matcher.
-```Lisp
+```Emacs-Lisp
(describe "The :to-be matcher compares with `eq'"
(it "and has a positive case"
(expect t :to-be t))
@@ -85,7 +85,7 @@ matchers (see the `buttercup-define-matcher` macro for further
information) for when a project’s domain calls for specific assertions
that are not included below.
-```Lisp
+```Emacs-Lisp
(describe "Included matchers:"
(it "The :to-be matcher compares with `eq'"
(let* ((a 12)
@@ -182,7 +182,7 @@ finding specs in a large suite. If you name them well, your
specs read
as full sentences in traditional
[BDD](http://en.wikipedia.org/wiki/Behavior-driven_development) style.
-```Lisp
+```Emacs-Lisp
(describe "A spec"
(it "is just a function, so it can contain any code"
(let ((foo 0))
@@ -213,7 +213,7 @@ variable under test is defined at the top-level scope — the
`describe`
block — and initialization code is moved into a `before-each` block.
The `after-each` block resets the variable before continuing.
-```Lisp
+```Emacs-Lisp
(describe "A spec using `before-each' and `after-each'"
:var (foo)
(before-each
@@ -241,7 +241,7 @@ However, be careful using `before-all` and `after-all`!
Since they are
not reset between specs, it is easy to accidentally leak state between
your specs so that they erroneously pass or fail.
-```Lisp
+```Emacs-Lisp
(describe "A spec using `before-all' and `after-all'"
:var (foo)
(before-all
@@ -266,7 +266,7 @@ spec is executed, Buttercup walks down the tree executing
each
`before-each` function in order. After the spec is executed, Buttercup
walks through the `after-each` functions similarly.
-```Lisp
+```Emacs-Lisp
(describe "A spec"
:var (foo)
(before-each
@@ -299,7 +299,7 @@ macros, respectively. These suites and any specs inside
them are
skipped when run and thus their results will not appear in the
results.
-```Lisp
+```Emacs-Lisp
(xdescribe "A spec"
:var (foo)
(before-each
@@ -319,7 +319,7 @@ Any spec declared with `xit` is marked as pending.
Any spec declared without a function body will also be marked as
pending in results.
-```Lisp
+```Emacs-Lisp
(describe "Pending specs"
(xit "can be declared using `xit'"
(expect t :to-be nil))
@@ -340,7 +340,7 @@ special matchers for interacting with spies. The
at all. The `:to-have-been-called-with` matcher will return true if
the argument list matches any of the recorded calls to the spy.
-```Lisp
+```Emacs-Lisp
(describe "A spy"
:var (foo bar)
(before-each
@@ -367,7 +367,7 @@ the argument list matches any of the recorded calls to the
spy.
The `:to-have-been-called-times` matcher will return true if the spy
was called a certain number of times.
-```Lisp
+```Emacs-Lisp
(describe "A spy"
:var (foo bar)
(before-each
@@ -389,7 +389,7 @@ was called a certain number of times.
The keyword argument `:and-call-through` to `spy-on` will make the spy
call the original function instead of returning `nil`.
-```Lisp
+```Emacs-Lisp
(describe "A spy, when configured to call through"
:var (bar set-bar get-bar fetched-bar)
(before-each
@@ -418,7 +418,7 @@ call the original function instead of returning `nil`.
The keyword argument `:and-return-value` specifies the value the
spied-on function should return.
-```Lisp
+```Emacs-Lisp
(describe "A spy, when configured to fake a return value"
:var (bar set-bar get-bar fetched-bar)
(before-each
@@ -447,7 +447,7 @@ spied-on function should return.
The keyword argument `:and-call-fake` delegates calls to a supplied
function.
-```Lisp
+```Emacs-Lisp
(describe "A spy, when configured with an alternate implementation"
:var (bar set-bar get-bar fetched-bar)
(before-each
@@ -476,7 +476,7 @@ function.
With the keyword argument `:and-throw-error`, all calls to the spy
will `signal` the specified value as an error.
-```Lisp
+```Emacs-Lisp
(describe "A spy, when configured to throw an error"
:var (bar set-bar get-bar fetched-bar)
(before-each
@@ -509,7 +509,7 @@ arguments for the first call.
Finally, `spy-calls-reset` clears all tracking for a spy.
-```Lisp
+```Emacs-Lisp
(describe "A spy"
:var (set-foo foo)
(before-each
- [nongnu] elpa/buttercup abf2abe 109/340: Exclude hidden files and dirs in test root, (continued)
- [nongnu] elpa/buttercup abf2abe 109/340: Exclude hidden files and dirs in test root, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup f60ed2a 119/340: Bump version: 1.5 → 1.6, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 677d6d3 118/340: Merge pull request #70 from xendk/color-output, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d8dc80d 126/340: Bump version: 1.6 → 1.7, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b6deeff 128/340: Set Emacs 24.3 as minimum and clean outdated code (close #89), ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 39c7d8c 132/340: Allow ERT "should" and similar to work with buttercup, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e8140aa 133/340: Implement configurable stack traces, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e6f97d0 136/340: Release 1.8, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e26ea54 137/340: Let spy-on :and-return-value work with lists and symbols (close #104), ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e55e3d8 138/340: travis: Test on 25.1 and 25.2, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup c032c8f 141/340: Exec code blocks in markdown labeled as "emacs-lisp" and "elisp",
ELPA Syncer <=
- [nongnu] elpa/buttercup b97714d 144/340: Declare all variables before first use, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 4128f3e 147/340: Document ERT support in writing-tests.md, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 47dd72c 156/340: Set file local variables for consistent code style, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5458dcc 158/340: Replace buttercup-*-parents with buttercup-suite-or-spec-parents, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 77367d3 165/340: Change shebang to use /usr/bin/env, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bbbf692 166/340: Fix more compile warnings., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bcaa7f0 163/340: Use buttercup--specs where possible, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 61ebe91 171/340: Update README.md, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 39d625c 173/340: Bump version: 1.11 → 1.12, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6330610 176/340: Add more markdown running functions, ELPA Syncer, 2021/12/16