私は Lua の初心者で、開発で単体テストを使用したいと考えています。そのために、シンプルで使いやすいフレームワークを使用することにしました。
require "yaci"
require "busted"
foo = {}
foor.bar = newclass( "foo.bar" )
function foo.bar:doSomething() return "foo bar" end
describe("Unit tests for Foo.Bar", function()
it("A first test", function()
local to_test = foo.bar()
local text = to_test:doSomething()
local a = { test = say }
local b = { test = "foo bar" }
assert.same( a, b )
end)
end
しかし、 foo.bar には到達できないようです...
attempt to index global 'foo' (a nil value)
彼らの外でdescribe
は問題ありません。
誰かが foo.bar に到達できない理由を説明してもらえますdescribe
か?
ありがとう