-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.lua
More file actions
85 lines (72 loc) · 2.03 KB
/
Copy pathtests.lua
File metadata and controls
85 lines (72 loc) · 2.03 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
local T = require('potential-octo-rotary-phone/test')
---------------------------------------- porcelain.lua
local P = require('porcelain')
T.it('init - no directory', function()
local init = P.init()
return T.expect(init.command, 'git init')
end)
T.it('init - directory', function()
local init = P.init('test')
return T.expect(init.command, 'git init test')
end)
T.it('status', function()
local status = P.status()
return T.expect(status.command, 'git status')
end)
T.it('checkout', function()
local checkout = P.checkout('test')
if checkout ~= nil then
return T.expect(checkout.command, 'git checkout test')
end
return T.assert('returned nil')
end)
T.it('new_branch', function()
local new_branch = P.new_branch('test')
if new_branch ~= nil then
return T.expect(new_branch.command, 'git checkout -b test')
end
return T.assert('returned nil')
end)
T.it('new_feature', function()
local new_feature = P.new_feature('test')
if new_feature ~= nil then
return T.expect(new_feature.command, 'git checkout -b feature/test')
end
return T.assert('returned nil')
end)
T.it('merge', function()
local merge = P.merge('test')
if merge ~= nil then
return T.expect(merge.command, 'git merge test')
end
return T.assert('returned nil')
end)
T.it('merge_feature', function()
local merge_feature = P.merge_feature('testing_feature')
if merge_feature ~= nil then
return T.expect(merge_feature.command, 'git merge feature/testing_feature')
end
return T.assert('returned nil')
end)
T.it('add', function()
local add = P.add('test')
if add ~= nil then
return T.expect(add.command, 'git add test')
end
return T.assert('returned nil')
end)
T.it('add all', function()
local add = P.add_all()
if add ~= nil then
return T.expect(add.command, 'git add .')
end
return T.assert('returned nil')
end)
T.it('commit', function()
local commit = P.commit('test')
if commit ~= nil then
return T.expect(commit.command, 'git commit -m \'test\'')
end
return T.assert('returned nil')
end)
T.run()