diff options
Diffstat (limited to 'spec/helpers.lua')
-rw-r--r-- | spec/helpers.lua | 16 |
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 @@ | |||
1 | local busted = require("busted") | ||
2 | |||
3 | local function is_windows() | ||
4 | return package.config:sub(1,1) == "\\" | ||
5 | end | ||
6 | |||
7 | local function postfixer(postfix) | ||
8 | return function(description, ...) | ||
9 | return busted.pending(description.." ["..postfix.."]", ...) | ||
10 | end | ||
11 | end | ||
12 | |||
13 | -- win_it only executes on Windows, and is "pending" otherwise | ||
14 | win_it = is_windows() and busted.it or postfixer("Windows only") | ||
15 | -- nix_it only executes on Unix/Mac, and is "pending" otherwise | ||
16 | nix_it = is_windows() and postfixer("Unix/Mac only") or busted.it | ||