forked from moul/node-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmock.coffee
More file actions
65 lines (59 loc) · 1.64 KB
/
mock.coffee
File metadata and controls
65 lines (59 loc) · 1.64 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
class Mock
constructor: ->
@path = ''
@projects = []
project =
id: 13
description: ''
default_branch: 'master'
public: false
visibility_level: 0
ssh_url_to_repo: 'git@demo.gitlab.com:sandbox/afro.git'
http_url_to_repo: 'http://demo.gitlab.com/sandbox/afro.git'
web_url: 'http://demo.gitlab.com/sandbox/afro'
owner:
id: 8
name: 'Sandbox'
created_at: '2013-08-01T16:44:17.000Z'
name: 'Afro'
name_with_namespace: 'Sandbox / Afro'
path: 'afro'
path_with_namespace: 'sandbox/afro'
issues_enabled: true
merge_requests_enabled: true
wall_enabled: false
wiki_enabled: true
snippets_enabled: false
created_at: '2013-11-14T17:45:19.000Z'
last_activity_at: '2014-01-16T15:32:07.000Z'
namespace:
id: 8
name: 'Sandbox'
path: 'sandbox'
owner_id: 1
created_at: '2013-08-01T16:44:17.000Z'
updated_at: '2013-08-01T16:44:17.000Z'
description: ''
@projects.push project
setup: (gitlab) =>
before =>
gitlab.slumber = (path) => @update_path(path)
beforeEach =>
do @beforeEach
update_path: (@path) =>
return @
defaults:
get: (opts, cb) ->
cb(null, {}, [{}]) if cb
delete: (opts, cb) ->
cb(null, {}, [{}]) if cb
post: (opts, cb) ->
cb(null, {}, [{}]) if cb
put: (opts, cb) ->
cb(null, {}, [{}]) if cb
patch: (opts, cb) ->
cb(null, {}, [{}]) if cb
beforeEach: =>
for method in ['get', 'delete', 'post', 'put', 'patch']
@[method] = @defaults[method]
module.exports = new Mock()