File: helpers.lua

package info (click to toggle)
lua-system 0.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 656 kB
  • sloc: ansic: 1,500; makefile: 222
file content (16 lines) | stat: -rw-r--r-- 511 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
local busted = require("busted")

local function is_windows()
  return package.config:sub(1,1) == "\\"
end

local function postfixer(postfix)
  return function(description, ...)
    return busted.pending(description.." ["..postfix.."]", ...)
  end
end

-- win_it only executes on Windows, and is "pending" otherwise
win_it = is_windows() and busted.it or postfixer("Windows only")
-- nix_it only executes on Unix/Mac, and is "pending" otherwise
nix_it = is_windows() and postfixer("Unix/Mac only") or busted.it