Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move "version" to _VERSION, add spec to Makefile

  • Loading branch information...
commit d9d7dc67fc112ae9584abd82b65452d70ca0266f 1 parent dd1f60d
@norman authored
Showing with 18 additions and 4 deletions.
  1. +4 −0 Makefile
  2. +11 −2 spec/telescope_spec.lua
  3. +3 −2 telescope.lua
View
4 Makefile
@@ -1,3 +1,4 @@
+.PHONY: test spec
LUA_DIR = /usr/local
LUA_VERSION = `lua -e 'print(_VERSION:sub(5,7))'`
LUA_SHARE = $(LUA_DIR)/share/lua/$(LUA_VERSION)
@@ -7,6 +8,9 @@ LUA_SHARE = $(LUA_DIR)/share/lua/$(LUA_VERSION)
test:
@./tsc spec/*.lua
+spec:
+ @./tsc -f spec/*.lua
+
docs: clean
ldoc.lua -t "Telescope API Docs" telescope.lua
View
13 spec/telescope_spec.lua
@@ -1,10 +1,19 @@
local telescope = require "telescope"
-describe("Telescope spec", function()
+describe("The Telescope Test Framework", function()
local contexts
- context("Syntax", function()
+ context("The Telescope module", function()
+ it("should have a 'version' member", function()
+ assert_equal("string", type(telescope.version))
+ end)
+ it("should have a '_VERSION' member", function()
+ assert_equal("string", type(telescope._VERSION))
+ end)
+ end)
+
+ context("Telescope's syntax", function()
before(function()
contexts = telescope.load_contexts("spec/fixtures/syntax.lua")
View
5 telescope.lua
@@ -12,7 +12,7 @@ local getfenv = _G.getfenv or compat_env.getfenv
local setfenv = _G.setfenv or compat_env.setfenv
-local version = "0.5.0"
+local _VERSION = "0.5.0"
--- The status codes that can be returned by an invoked test. These should not be overidden.
-- @name status_codes
@@ -546,7 +546,8 @@ local telescope = {
status_labels = status_labels,
summary_report = summary_report,
test_aliases = test_aliases,
- version = version
+ version = _VERSION,
+ _VERSION = _VERSION
}
return telescope
Please sign in to comment.
Something went wrong with that request. Please try again.