aboutsummaryrefslogtreecommitdiff
path: root/spec/helpers.lua
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2024-03-24 15:02:15 +0100
committerGitHub <noreply@github.com>2024-03-24 15:02:15 +0100
commit47c24eed0191f8f72646be63dee94ac2b35eb062 (patch)
tree808fc02c608fd56e93cd502069adcba9c561df7d /spec/helpers.lua
parent8fe13074a7d9fdd88c5423d1e9c5fcc4ec43a57b (diff)
downloadluasystem-47c24eed0191f8f72646be63dee94ac2b35eb062.tar.gz
luasystem-47c24eed0191f8f72646be63dee94ac2b35eb062.tar.bz2
luasystem-47c24eed0191f8f72646be63dee94ac2b35eb062.zip
chore(test): add tests (manual) for isatty terminal function (#22)
Diffstat (limited to 'spec/helpers.lua')
-rw-r--r--spec/helpers.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/helpers.lua b/spec/helpers.lua
new file mode 100644
index 0000000..8f766e7
--- /dev/null
+++ b/spec/helpers.lua
@@ -0,0 +1,16 @@
1local busted = require("busted")
2
3local function is_windows()
4 return package.config:sub(1,1) == "\\"
5end
6
7local function postfixer(postfix)
8 return function(description, ...)
9 return busted.pending(description.." ["..postfix.."]", ...)
10 end
11end
12
13-- win_it only executes on Windows, and is "pending" otherwise
14win_it = is_windows() and busted.it or postfixer("Windows only")
15-- nix_it only executes on Unix/Mac, and is "pending" otherwise
16nix_it = is_windows() and postfixer("Unix/Mac only") or busted.it