test_spec.lua 805 B

123456789101112131415161718192021222324252627
  1. describe("Busted unit testing framework", function()
  2. describe("should be awesome", function()
  3. it("should be easy to use", function()
  4. assert.truthy("Yup.")
  5. end)
  6. it("should have lots of features", function()
  7. -- deep check comparisons!
  8. assert.are.same({ table = "great"}, { table = "great" })
  9. -- or check by reference!
  10. assert.are_not.equal({ table = "great"}, { table = "great"})
  11. assert.truthy("this is a string") -- truthy: not false or nil
  12. assert.True(1 == 1)
  13. assert.is_true(1 == 1)
  14. assert.falsy(nil)
  15. assert.has_error(function() error("Wat") end, "Wat")
  16. end)
  17. it("should provide some shortcuts to common functions", function()
  18. assert.are.unique({{ thing = 1 }, { thing = 2 }, { thing = 3 }})
  19. end)
  20. end)
  21. end)