aboutsummaryrefslogtreecommitdiff
path: root/spec/helpers.lua
diff options
context:
space:
mode:
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