From 69fe6c4d21d885f1397172605e8babe639a945c5 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 23 Dec 2014 19:51:12 +0000 Subject: cmd_account_shows_account_when_connected_and_no_args --- tests/config/stub_accounts.c | 20 +++++++++++++++++++- tests/config/stub_accounts.h | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/config/stub_accounts.h (limited to 'tests/config') diff --git a/tests/config/stub_accounts.c b/tests/config/stub_accounts.c index d2333fee..001be6d8 100644 --- a/tests/config/stub_accounts.c +++ b/tests/config/stub_accounts.c @@ -1,6 +1,24 @@ #include "common.h" #include "config/account.h" +// mock state + +static ProfAccount *account = NULL; + +void +reset_account_mocks(void) +{ + account = NULL; +} + +void +mock_accounts_get_account(ProfAccount *given_account) +{ + account = given_account; +} + +// stubs + void accounts_load(void) {} void accounts_close(void) {} @@ -29,7 +47,7 @@ gchar** accounts_get_list(void) ProfAccount* accounts_get_account(const char * const name) { - return NULL; + return account; } gboolean accounts_enable(const char * const name) diff --git a/tests/config/stub_accounts.h b/tests/config/stub_accounts.h new file mode 100644 index 00000000..1510f389 --- /dev/null +++ b/tests/config/stub_accounts.h @@ -0,0 +1,2 @@ +void reset_account_mocks(void); +void mock_accounts_get_account(ProfAccount *given_account); \ No newline at end of file -- cgit 1.4.1-2-gfad0 ca9b522c9'>commit diff stats
path: root/handlers_test.go
blob: b4095211889699e186be682c459836f4be12514a (plain) (blame)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127