-
Notifications
You must be signed in to change notification settings - Fork 0
/
fizz_buzz_spec.lua
40 lines (34 loc) · 923 Bytes
/
fizz_buzz_spec.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'busted.runner'()
FizzBuzz = require("fizz_buzz")
describe("fizz buzz", function()
describe("Given a 1", function()
it("returns a 1", function()
assert.is_equal(1, FizzBuzz.calculate(1))
end)
end)
describe("Given a 2", function()
it("returns a 2", function()
assert.is_equal(2, FizzBuzz.calculate(2))
end)
end)
describe("Given a 3", function()
it("returns Fizz", function()
assert.is_equal("Fizz", FizzBuzz.calculate(3))
end)
end)
describe("Given a 5", function()
it("returns Buzz", function()
assert.is_equal("Buzz", FizzBuzz.calculate(5))
end)
end)
describe("Given a 14", function()
it("returns 14", function()
assert.is_equal(14, FizzBuzz.calculate(14))
end)
end)
describe("Given a 15", function()
it("returns FizzBuzz", function()
assert.is_equal("FizzBuzz", FizzBuzz.calculate(15))
end)
end)
end)