Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run busted in ios with multiple unit_test file #612

Open
gopep9 opened this issue Sep 3, 2019 · 3 comments
Open

How to run busted in ios with multiple unit_test file #612

gopep9 opened this issue Sep 3, 2019 · 3 comments

Comments

@gopep9
Copy link

gopep9 commented Sep 3, 2019

I want to use busted in ios lua project. Now I can run busted like this

--unitTest.lua
require 'busted.runner'()
describe("Busted unit testing framework", function()
	-- body
	describe("should be awesome", function()
		it("should be easy to use", function()
			print(package.path)
			assert.truthy("Yup.")
		end)
	end)
end)
--main.lua
require("unitTest")

but it seem like the unit test code must be write in the one lua file. is it any way to write unit test code in multiple lua file and run them?

@gopep9
Copy link
Author

gopep9 commented Sep 3, 2019

I find a way to do this by string concatenation,just like this

total_str = ""

local file = io.open("a.lua","r")
a_str = file:read("*a")
file:close()
total_str = total_str..a_str

file = io.open("b.lua","r")
b_str = file:read("*a")
file:close()
total_str = total_str..b_str

load(total_str)()

@ildar
Copy link

ildar commented Sep 3, 2019 via email

@EricFedrowisch
Copy link

Here's one way I found:
#571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants