File: cl_randomize.lua

package info (click to toggle)
lua-busted 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 820 kB
  • sloc: sh: 198; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 399 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- supporting testfile; belongs to 'cl_spec.lua'
local unexpected = {}
local order = {}

describe('Randomizing test order with --shuffle flag', function()
  for i = 1, 100 do
    table.insert(unexpected, i)

    it('does 100 its', function()
      table.insert(order, i)
    end)
  end

  teardown('runs tests in randomized order', function()
    assert.are_not.same(unexpected, order)
  end)
end)