-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_test.rb
More file actions
270 lines (182 loc) · 6.5 KB
/
Copy pathclient_test.rb
File metadata and controls
270 lines (182 loc) · 6.5 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# frozen_string_literal: true
# Generated by weaver ruby-sdk generator — do not edit manually
require "test_helper"
class Paystack::ClientTest < Minitest::Test
def setup
@client = Paystack::Client.new("sk_test_xxx")
end
def test_exposes_apple_pay_resource
assert_instance_of Paystack::Resources::ApplePay, @client.apple_pay
end
def test_memoizes_apple_pay_resource
assert_same @client.apple_pay, @client.apple_pay
end
def test_exposes_balance_resource
assert_instance_of Paystack::Resources::Balance, @client.balance
end
def test_memoizes_balance_resource
assert_same @client.balance, @client.balance
end
def test_exposes_bank_resource
assert_instance_of Paystack::Resources::Bank, @client.bank
end
def test_memoizes_bank_resource
assert_same @client.bank, @client.bank
end
def test_exposes_bulk_charge_resource
assert_instance_of Paystack::Resources::BulkCharge, @client.bulk_charge
end
def test_memoizes_bulk_charge_resource
assert_same @client.bulk_charge, @client.bulk_charge
end
def test_exposes_charge_resource
assert_instance_of Paystack::Resources::Charge, @client.charge
end
def test_memoizes_charge_resource
assert_same @client.charge, @client.charge
end
def test_exposes_customer_resource
assert_instance_of Paystack::Resources::Customer, @client.customer
end
def test_memoizes_customer_resource
assert_same @client.customer, @client.customer
end
def test_exposes_dedicated_virtual_account_resource
assert_instance_of Paystack::Resources::DedicatedVirtualAccount, @client.dedicated_virtual_account
end
def test_memoizes_dedicated_virtual_account_resource
assert_same @client.dedicated_virtual_account, @client.dedicated_virtual_account
end
def test_exposes_direct_debit_resource
assert_instance_of Paystack::Resources::DirectDebit, @client.direct_debit
end
def test_memoizes_direct_debit_resource
assert_same @client.direct_debit, @client.direct_debit
end
def test_exposes_dispute_resource
assert_instance_of Paystack::Resources::Dispute, @client.dispute
end
def test_memoizes_dispute_resource
assert_same @client.dispute, @client.dispute
end
def test_exposes_integration_resource
assert_instance_of Paystack::Resources::Integration, @client.integration
end
def test_memoizes_integration_resource
assert_same @client.integration, @client.integration
end
def test_exposes_miscellaneous_resource
assert_instance_of Paystack::Resources::Miscellaneous, @client.miscellaneous
end
def test_memoizes_miscellaneous_resource
assert_same @client.miscellaneous, @client.miscellaneous
end
def test_exposes_order_resource
assert_instance_of Paystack::Resources::Order, @client.order
end
def test_memoizes_order_resource
assert_same @client.order, @client.order
end
def test_exposes_page_resource
assert_instance_of Paystack::Resources::Page, @client.page
end
def test_memoizes_page_resource
assert_same @client.page, @client.page
end
def test_exposes_payment_request_resource
assert_instance_of Paystack::Resources::PaymentRequest, @client.payment_request
end
def test_memoizes_payment_request_resource
assert_same @client.payment_request, @client.payment_request
end
def test_exposes_plan_resource
assert_instance_of Paystack::Resources::Plan, @client.plan
end
def test_memoizes_plan_resource
assert_same @client.plan, @client.plan
end
def test_exposes_product_resource
assert_instance_of Paystack::Resources::Product, @client.product
end
def test_memoizes_product_resource
assert_same @client.product, @client.product
end
def test_exposes_refund_resource
assert_instance_of Paystack::Resources::Refund, @client.refund
end
def test_memoizes_refund_resource
assert_same @client.refund, @client.refund
end
def test_exposes_settlement_resource
assert_instance_of Paystack::Resources::Settlement, @client.settlement
end
def test_memoizes_settlement_resource
assert_same @client.settlement, @client.settlement
end
def test_exposes_split_resource
assert_instance_of Paystack::Resources::Split, @client.split
end
def test_memoizes_split_resource
assert_same @client.split, @client.split
end
def test_exposes_storefront_resource
assert_instance_of Paystack::Resources::Storefront, @client.storefront
end
def test_memoizes_storefront_resource
assert_same @client.storefront, @client.storefront
end
def test_exposes_subaccount_resource
assert_instance_of Paystack::Resources::Subaccount, @client.subaccount
end
def test_memoizes_subaccount_resource
assert_same @client.subaccount, @client.subaccount
end
def test_exposes_subscription_resource
assert_instance_of Paystack::Resources::Subscription, @client.subscription
end
def test_memoizes_subscription_resource
assert_same @client.subscription, @client.subscription
end
def test_exposes_terminal_resource
assert_instance_of Paystack::Resources::Terminal, @client.terminal
end
def test_memoizes_terminal_resource
assert_same @client.terminal, @client.terminal
end
def test_exposes_transaction_resource
assert_instance_of Paystack::Resources::Transaction, @client.transaction
end
def test_memoizes_transaction_resource
assert_same @client.transaction, @client.transaction
end
def test_exposes_transfer_resource
assert_instance_of Paystack::Resources::Transfer, @client.transfer
end
def test_memoizes_transfer_resource
assert_same @client.transfer, @client.transfer
end
def test_exposes_transfer_recipient_resource
assert_instance_of Paystack::Resources::TransferRecipient, @client.transfer_recipient
end
def test_memoizes_transfer_recipient_resource
assert_same @client.transfer_recipient, @client.transfer_recipient
end
def test_exposes_virtual_terminal_resource
assert_instance_of Paystack::Resources::VirtualTerminal, @client.virtual_terminal
end
def test_memoizes_virtual_terminal_resource
assert_same @client.virtual_terminal, @client.virtual_terminal
end
def test_inspect_masks_the_api_key
key = "sk_test_abcdefghijklmnopqrstuvwxyz"
client = Paystack::Client.new(key)
refute_includes client.inspect, key
assert_includes client.inspect, key[0, 8]
assert_includes client.inspect, key[-4, 4]
end
def test_to_s_masks_the_api_key
key = "sk_test_abcdefghijklmnopqrstuvwxyz"
client = Paystack::Client.new(key)
refute_includes client.to_s, key
end
end