money_parser 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1693 @@
1
+ require 'spec_helper'
2
+ describe MoneyParser do
3
+
4
+
5
+ it '"2000.01" should be parsed as 2000.01 ' do
6
+ MoneyParser.parse("2000.01").should == BigDecimal.new("2000.01")
7
+ end
8
+
9
+
10
+ it '" - 2000.01" should be parsed as -2000.01 (negative amount)' do
11
+ MoneyParser.parse(" - 2000.01").should == BigDecimal.new("-2000.01")
12
+ end
13
+
14
+
15
+ it '"20o0.01" should be parsed as 2000.01 (with O instead of 0)' do
16
+ MoneyParser.parse("20o0.01").should == BigDecimal.new("2000.01")
17
+ end
18
+
19
+
20
+ it '"$2000.01" should be parsed as 2000.01 (with a dollar sign)' do
21
+ MoneyParser.parse("$2000.01").should == BigDecimal.new("2000.01")
22
+ end
23
+
24
+
25
+ it '"€2000.01" should be parsed as 2000.01 (with a euro sign)' do
26
+ MoneyParser.parse("€2000.01").should == BigDecimal.new("2000.01")
27
+ end
28
+
29
+
30
+ it '"£2000.01" should be parsed as 2000.01 (with a pound sign)' do
31
+ MoneyParser.parse("£2000.01").should == BigDecimal.new("2000.01")
32
+ end
33
+
34
+
35
+ it '"₤2000.01" should be parsed as 2000.01 (with a pound sign)' do
36
+ MoneyParser.parse("₤2000.01").should == BigDecimal.new("2000.01")
37
+ end
38
+
39
+
40
+ it '"2000,01" should be parsed as 2000.01 ' do
41
+ MoneyParser.parse("2000,01").should == BigDecimal.new("2000.01")
42
+ end
43
+
44
+
45
+ it '"- 2000,01" should be parsed as -2000.01 (negative amount)' do
46
+ MoneyParser.parse("- 2000,01").should == BigDecimal.new("-2000.01")
47
+ end
48
+
49
+
50
+ it '"2o00,01" should be parsed as 2000.01 (with O instead of 0)' do
51
+ MoneyParser.parse("2o00,01").should == BigDecimal.new("2000.01")
52
+ end
53
+
54
+
55
+ it '"$2000,01" should be parsed as 2000.01 (with a dollar sign)' do
56
+ MoneyParser.parse("$2000,01").should == BigDecimal.new("2000.01")
57
+ end
58
+
59
+
60
+ it '"€2000,01" should be parsed as 2000.01 (with a euro sign)' do
61
+ MoneyParser.parse("€2000,01").should == BigDecimal.new("2000.01")
62
+ end
63
+
64
+
65
+ it '"£2000,01" should be parsed as 2000.01 (with a pound sign)' do
66
+ MoneyParser.parse("£2000,01").should == BigDecimal.new("2000.01")
67
+ end
68
+
69
+
70
+ it '"₤2000,01" should be parsed as 2000.01 (with a pound sign)' do
71
+ MoneyParser.parse("₤2000,01").should == BigDecimal.new("2000.01")
72
+ end
73
+
74
+
75
+ it '"2000.1" should be parsed as 2000.1 ' do
76
+ MoneyParser.parse("2000.1").should == BigDecimal.new("2000.1")
77
+ end
78
+
79
+
80
+ it '" - 2000.1" should be parsed as -2000.1 (negative amount)' do
81
+ MoneyParser.parse(" - 2000.1").should == BigDecimal.new("-2000.1")
82
+ end
83
+
84
+
85
+ it '"20o0.1" should be parsed as 2000.1 (with O instead of 0)' do
86
+ MoneyParser.parse("20o0.1").should == BigDecimal.new("2000.1")
87
+ end
88
+
89
+
90
+ it '"$2000.1" should be parsed as 2000.1 (with a dollar sign)' do
91
+ MoneyParser.parse("$2000.1").should == BigDecimal.new("2000.1")
92
+ end
93
+
94
+
95
+ it '"€2000.1" should be parsed as 2000.1 (with a euro sign)' do
96
+ MoneyParser.parse("€2000.1").should == BigDecimal.new("2000.1")
97
+ end
98
+
99
+
100
+ it '"£2000.1" should be parsed as 2000.1 (with a pound sign)' do
101
+ MoneyParser.parse("£2000.1").should == BigDecimal.new("2000.1")
102
+ end
103
+
104
+
105
+ it '"₤2000.1" should be parsed as 2000.1 (with a pound sign)' do
106
+ MoneyParser.parse("₤2000.1").should == BigDecimal.new("2000.1")
107
+ end
108
+
109
+
110
+ it '"2000,1" should be parsed as 2000.1 ' do
111
+ MoneyParser.parse("2000,1").should == BigDecimal.new("2000.1")
112
+ end
113
+
114
+
115
+ it '" -2000,1" should be parsed as -2000.1 (negative amount)' do
116
+ MoneyParser.parse(" -2000,1").should == BigDecimal.new("-2000.1")
117
+ end
118
+
119
+
120
+ it '"20o0,1" should be parsed as 2000.1 (with O instead of 0)' do
121
+ MoneyParser.parse("20o0,1").should == BigDecimal.new("2000.1")
122
+ end
123
+
124
+
125
+ it '"$2000,1" should be parsed as 2000.1 (with a dollar sign)' do
126
+ MoneyParser.parse("$2000,1").should == BigDecimal.new("2000.1")
127
+ end
128
+
129
+
130
+ it '"€2000,1" should be parsed as 2000.1 (with a euro sign)' do
131
+ MoneyParser.parse("€2000,1").should == BigDecimal.new("2000.1")
132
+ end
133
+
134
+
135
+ it '"£2000,1" should be parsed as 2000.1 (with a pound sign)' do
136
+ MoneyParser.parse("£2000,1").should == BigDecimal.new("2000.1")
137
+ end
138
+
139
+
140
+ it '"₤2000,1" should be parsed as 2000.1 (with a pound sign)' do
141
+ MoneyParser.parse("₤2000,1").should == BigDecimal.new("2000.1")
142
+ end
143
+
144
+
145
+ it '"2000" should be parsed as 2000.0 ' do
146
+ MoneyParser.parse("2000").should == BigDecimal.new("2000.0")
147
+ end
148
+
149
+
150
+ it '" - 2000" should be parsed as -2000.0 (negative amount)' do
151
+ MoneyParser.parse(" - 2000").should == BigDecimal.new("-2000.0")
152
+ end
153
+
154
+
155
+ it '"20o0" should be parsed as 2000.0 (with O instead of 0)' do
156
+ MoneyParser.parse("20o0").should == BigDecimal.new("2000.0")
157
+ end
158
+
159
+
160
+ it '"$2000" should be parsed as 2000.0 (with a dollar sign)' do
161
+ MoneyParser.parse("$2000").should == BigDecimal.new("2000.0")
162
+ end
163
+
164
+
165
+ it '"€2000" should be parsed as 2000.0 (with a euro sign)' do
166
+ MoneyParser.parse("€2000").should == BigDecimal.new("2000.0")
167
+ end
168
+
169
+
170
+ it '"£2000" should be parsed as 2000.0 (with a pound sign)' do
171
+ MoneyParser.parse("£2000").should == BigDecimal.new("2000.0")
172
+ end
173
+
174
+
175
+ it '"₤2000" should be parsed as 2000.0 (with a pound sign)' do
176
+ MoneyParser.parse("₤2000").should == BigDecimal.new("2000.0")
177
+ end
178
+
179
+
180
+ it '".01" should be parsed as 0.01 ' do
181
+ MoneyParser.parse(".01").should == BigDecimal.new("0.01")
182
+ end
183
+
184
+
185
+ it '" - .01" should be parsed as -0.01 (negative amount)' do
186
+ MoneyParser.parse(" - .01").should == BigDecimal.new("-0.01")
187
+ end
188
+
189
+
190
+ it '".o1" should be parsed as 0.01 (with O instead of 0)' do
191
+ MoneyParser.parse(".o1").should == BigDecimal.new("0.01")
192
+ end
193
+
194
+
195
+ it '"$.01" should be parsed as 0.01 (with a dollar sign)' do
196
+ MoneyParser.parse("$.01").should == BigDecimal.new("0.01")
197
+ end
198
+
199
+
200
+ it '"€.01" should be parsed as 0.01 (with a euro sign)' do
201
+ MoneyParser.parse("€.01").should == BigDecimal.new("0.01")
202
+ end
203
+
204
+
205
+ it '"£.01" should be parsed as 0.01 (with a pound sign)' do
206
+ MoneyParser.parse("£.01").should == BigDecimal.new("0.01")
207
+ end
208
+
209
+
210
+ it '"₤.01" should be parsed as 0.01 (with a pound sign)' do
211
+ MoneyParser.parse("₤.01").should == BigDecimal.new("0.01")
212
+ end
213
+
214
+
215
+ it '",01" should be parsed as 0.01 ' do
216
+ MoneyParser.parse(",01").should == BigDecimal.new("0.01")
217
+ end
218
+
219
+
220
+ it '"- ,01" should be parsed as -0.01 (negative amount)' do
221
+ MoneyParser.parse("- ,01").should == BigDecimal.new("-0.01")
222
+ end
223
+
224
+
225
+ it '",o1" should be parsed as 0.01 (with O instead of 0)' do
226
+ MoneyParser.parse(",o1").should == BigDecimal.new("0.01")
227
+ end
228
+
229
+
230
+ it '"$,01" should be parsed as 0.01 (with a dollar sign)' do
231
+ MoneyParser.parse("$,01").should == BigDecimal.new("0.01")
232
+ end
233
+
234
+
235
+ it '"€,01" should be parsed as 0.01 (with a euro sign)' do
236
+ MoneyParser.parse("€,01").should == BigDecimal.new("0.01")
237
+ end
238
+
239
+
240
+ it '"£,01" should be parsed as 0.01 (with a pound sign)' do
241
+ MoneyParser.parse("£,01").should == BigDecimal.new("0.01")
242
+ end
243
+
244
+
245
+ it '"₤,01" should be parsed as 0.01 (with a pound sign)' do
246
+ MoneyParser.parse("₤,01").should == BigDecimal.new("0.01")
247
+ end
248
+
249
+
250
+ it '"0.01" should be parsed as 0.01 ' do
251
+ MoneyParser.parse("0.01").should == BigDecimal.new("0.01")
252
+ end
253
+
254
+
255
+ it '" - 0.01" should be parsed as -0.01 (negative amount)' do
256
+ MoneyParser.parse(" - 0.01").should == BigDecimal.new("-0.01")
257
+ end
258
+
259
+
260
+ it '"o.01" should be parsed as 0.01 (with O instead of 0)' do
261
+ MoneyParser.parse("o.01").should == BigDecimal.new("0.01")
262
+ end
263
+
264
+
265
+ it '"$0.01" should be parsed as 0.01 (with a dollar sign)' do
266
+ MoneyParser.parse("$0.01").should == BigDecimal.new("0.01")
267
+ end
268
+
269
+
270
+ it '"€0.01" should be parsed as 0.01 (with a euro sign)' do
271
+ MoneyParser.parse("€0.01").should == BigDecimal.new("0.01")
272
+ end
273
+
274
+
275
+ it '"£0.01" should be parsed as 0.01 (with a pound sign)' do
276
+ MoneyParser.parse("£0.01").should == BigDecimal.new("0.01")
277
+ end
278
+
279
+
280
+ it '"₤0.01" should be parsed as 0.01 (with a pound sign)' do
281
+ MoneyParser.parse("₤0.01").should == BigDecimal.new("0.01")
282
+ end
283
+
284
+
285
+ it '"0,01" should be parsed as 0.01 ' do
286
+ MoneyParser.parse("0,01").should == BigDecimal.new("0.01")
287
+ end
288
+
289
+
290
+ it '" -0,01" should be parsed as -0.01 (negative amount)' do
291
+ MoneyParser.parse(" -0,01").should == BigDecimal.new("-0.01")
292
+ end
293
+
294
+
295
+ it '"0,o1" should be parsed as 0.01 (with O instead of 0)' do
296
+ MoneyParser.parse("0,o1").should == BigDecimal.new("0.01")
297
+ end
298
+
299
+
300
+ it '"$0,01" should be parsed as 0.01 (with a dollar sign)' do
301
+ MoneyParser.parse("$0,01").should == BigDecimal.new("0.01")
302
+ end
303
+
304
+
305
+ it '"€0,01" should be parsed as 0.01 (with a euro sign)' do
306
+ MoneyParser.parse("€0,01").should == BigDecimal.new("0.01")
307
+ end
308
+
309
+
310
+ it '"£0,01" should be parsed as 0.01 (with a pound sign)' do
311
+ MoneyParser.parse("£0,01").should == BigDecimal.new("0.01")
312
+ end
313
+
314
+
315
+ it '"₤0,01" should be parsed as 0.01 (with a pound sign)' do
316
+ MoneyParser.parse("₤0,01").should == BigDecimal.new("0.01")
317
+ end
318
+
319
+
320
+ it '".1" should be parsed as 0.1 ' do
321
+ MoneyParser.parse(".1").should == BigDecimal.new("0.1")
322
+ end
323
+
324
+
325
+ it '" - .1" should be parsed as -0.1 (negative amount)' do
326
+ MoneyParser.parse(" - .1").should == BigDecimal.new("-0.1")
327
+ end
328
+
329
+
330
+ it '"$.1" should be parsed as 0.1 (with a dollar sign)' do
331
+ MoneyParser.parse("$.1").should == BigDecimal.new("0.1")
332
+ end
333
+
334
+
335
+ it '"€.1" should be parsed as 0.1 (with a euro sign)' do
336
+ MoneyParser.parse("€.1").should == BigDecimal.new("0.1")
337
+ end
338
+
339
+
340
+ it '"£.1" should be parsed as 0.1 (with a pound sign)' do
341
+ MoneyParser.parse("£.1").should == BigDecimal.new("0.1")
342
+ end
343
+
344
+
345
+ it '"₤.1" should be parsed as 0.1 (with a pound sign)' do
346
+ MoneyParser.parse("₤.1").should == BigDecimal.new("0.1")
347
+ end
348
+
349
+
350
+ it '",1" should be parsed as 0.1 ' do
351
+ MoneyParser.parse(",1").should == BigDecimal.new("0.1")
352
+ end
353
+
354
+
355
+ it '"- ,1" should be parsed as -0.1 (negative amount)' do
356
+ MoneyParser.parse("- ,1").should == BigDecimal.new("-0.1")
357
+ end
358
+
359
+
360
+ it '"$,1" should be parsed as 0.1 (with a dollar sign)' do
361
+ MoneyParser.parse("$,1").should == BigDecimal.new("0.1")
362
+ end
363
+
364
+
365
+ it '"€,1" should be parsed as 0.1 (with a euro sign)' do
366
+ MoneyParser.parse("€,1").should == BigDecimal.new("0.1")
367
+ end
368
+
369
+
370
+ it '"£,1" should be parsed as 0.1 (with a pound sign)' do
371
+ MoneyParser.parse("£,1").should == BigDecimal.new("0.1")
372
+ end
373
+
374
+
375
+ it '"₤,1" should be parsed as 0.1 (with a pound sign)' do
376
+ MoneyParser.parse("₤,1").should == BigDecimal.new("0.1")
377
+ end
378
+
379
+
380
+ it '"0.1" should be parsed as 0.1 ' do
381
+ MoneyParser.parse("0.1").should == BigDecimal.new("0.1")
382
+ end
383
+
384
+
385
+ it '" - 0.1" should be parsed as -0.1 (negative amount)' do
386
+ MoneyParser.parse(" - 0.1").should == BigDecimal.new("-0.1")
387
+ end
388
+
389
+
390
+ it '"o.1" should be parsed as 0.1 (with O instead of 0)' do
391
+ MoneyParser.parse("o.1").should == BigDecimal.new("0.1")
392
+ end
393
+
394
+
395
+ it '"$0.1" should be parsed as 0.1 (with a dollar sign)' do
396
+ MoneyParser.parse("$0.1").should == BigDecimal.new("0.1")
397
+ end
398
+
399
+
400
+ it '"€0.1" should be parsed as 0.1 (with a euro sign)' do
401
+ MoneyParser.parse("€0.1").should == BigDecimal.new("0.1")
402
+ end
403
+
404
+
405
+ it '"£0.1" should be parsed as 0.1 (with a pound sign)' do
406
+ MoneyParser.parse("£0.1").should == BigDecimal.new("0.1")
407
+ end
408
+
409
+
410
+ it '"₤0.1" should be parsed as 0.1 (with a pound sign)' do
411
+ MoneyParser.parse("₤0.1").should == BigDecimal.new("0.1")
412
+ end
413
+
414
+
415
+ it '"0,1" should be parsed as 0.1 ' do
416
+ MoneyParser.parse("0,1").should == BigDecimal.new("0.1")
417
+ end
418
+
419
+
420
+ it '"-0,1" should be parsed as -0.1 (negative amount)' do
421
+ MoneyParser.parse("-0,1").should == BigDecimal.new("-0.1")
422
+ end
423
+
424
+
425
+ it '"o,1" should be parsed as 0.1 (with O instead of 0)' do
426
+ MoneyParser.parse("o,1").should == BigDecimal.new("0.1")
427
+ end
428
+
429
+
430
+ it '"$0,1" should be parsed as 0.1 (with a dollar sign)' do
431
+ MoneyParser.parse("$0,1").should == BigDecimal.new("0.1")
432
+ end
433
+
434
+
435
+ it '"€0,1" should be parsed as 0.1 (with a euro sign)' do
436
+ MoneyParser.parse("€0,1").should == BigDecimal.new("0.1")
437
+ end
438
+
439
+
440
+ it '"£0,1" should be parsed as 0.1 (with a pound sign)' do
441
+ MoneyParser.parse("£0,1").should == BigDecimal.new("0.1")
442
+ end
443
+
444
+
445
+ it '"₤0,1" should be parsed as 0.1 (with a pound sign)' do
446
+ MoneyParser.parse("₤0,1").should == BigDecimal.new("0.1")
447
+ end
448
+
449
+
450
+ it '"2,000.01" should be parsed as 2000.01 ' do
451
+ MoneyParser.parse("2,000.01").should == BigDecimal.new("2000.01")
452
+ end
453
+
454
+
455
+ it '" - 2,000.01" should be parsed as -2000.01 (negative amount)' do
456
+ MoneyParser.parse(" - 2,000.01").should == BigDecimal.new("-2000.01")
457
+ end
458
+
459
+
460
+ it '"2,000.o1" should be parsed as 2000.01 (with O instead of 0)' do
461
+ MoneyParser.parse("2,000.o1").should == BigDecimal.new("2000.01")
462
+ end
463
+
464
+
465
+ it '"$2,000.01" should be parsed as 2000.01 (with a dollar sign)' do
466
+ MoneyParser.parse("$2,000.01").should == BigDecimal.new("2000.01")
467
+ end
468
+
469
+
470
+ it '"€2,000.01" should be parsed as 2000.01 (with a euro sign)' do
471
+ MoneyParser.parse("€2,000.01").should == BigDecimal.new("2000.01")
472
+ end
473
+
474
+
475
+ it '"£2,000.01" should be parsed as 2000.01 (with a pound sign)' do
476
+ MoneyParser.parse("£2,000.01").should == BigDecimal.new("2000.01")
477
+ end
478
+
479
+
480
+ it '"₤2,000.01" should be parsed as 2000.01 (with a pound sign)' do
481
+ MoneyParser.parse("₤2,000.01").should == BigDecimal.new("2000.01")
482
+ end
483
+
484
+
485
+ it '"2.000,01" should be parsed as 2000.01 ' do
486
+ MoneyParser.parse("2.000,01").should == BigDecimal.new("2000.01")
487
+ end
488
+
489
+
490
+ it '" -2.000,01" should be parsed as -2000.01 (negative amount)' do
491
+ MoneyParser.parse(" -2.000,01").should == BigDecimal.new("-2000.01")
492
+ end
493
+
494
+
495
+ it '"2.000,o1" should be parsed as 2000.01 (with O instead of 0)' do
496
+ MoneyParser.parse("2.000,o1").should == BigDecimal.new("2000.01")
497
+ end
498
+
499
+
500
+ it '"$2.000,01" should be parsed as 2000.01 (with a dollar sign)' do
501
+ MoneyParser.parse("$2.000,01").should == BigDecimal.new("2000.01")
502
+ end
503
+
504
+
505
+ it '"€2.000,01" should be parsed as 2000.01 (with a euro sign)' do
506
+ MoneyParser.parse("€2.000,01").should == BigDecimal.new("2000.01")
507
+ end
508
+
509
+
510
+ it '"£2.000,01" should be parsed as 2000.01 (with a pound sign)' do
511
+ MoneyParser.parse("£2.000,01").should == BigDecimal.new("2000.01")
512
+ end
513
+
514
+
515
+ it '"₤2.000,01" should be parsed as 2000.01 (with a pound sign)' do
516
+ MoneyParser.parse("₤2.000,01").should == BigDecimal.new("2000.01")
517
+ end
518
+
519
+
520
+ it '"2 000.01" should be parsed as 2000.01 ' do
521
+ MoneyParser.parse("2 000.01").should == BigDecimal.new("2000.01")
522
+ end
523
+
524
+
525
+ it '"-2 000.01" should be parsed as -2000.01 (negative amount)' do
526
+ MoneyParser.parse("-2 000.01").should == BigDecimal.new("-2000.01")
527
+ end
528
+
529
+
530
+ it '"2 00o.01" should be parsed as 2000.01 (with O instead of 0)' do
531
+ MoneyParser.parse("2 00o.01").should == BigDecimal.new("2000.01")
532
+ end
533
+
534
+
535
+ it '"$2 000.01" should be parsed as 2000.01 (with a dollar sign)' do
536
+ MoneyParser.parse("$2 000.01").should == BigDecimal.new("2000.01")
537
+ end
538
+
539
+
540
+ it '"€2 000.01" should be parsed as 2000.01 (with a euro sign)' do
541
+ MoneyParser.parse("€2 000.01").should == BigDecimal.new("2000.01")
542
+ end
543
+
544
+
545
+ it '"£2 000.01" should be parsed as 2000.01 (with a pound sign)' do
546
+ MoneyParser.parse("£2 000.01").should == BigDecimal.new("2000.01")
547
+ end
548
+
549
+
550
+ it '"₤2 000.01" should be parsed as 2000.01 (with a pound sign)' do
551
+ MoneyParser.parse("₤2 000.01").should == BigDecimal.new("2000.01")
552
+ end
553
+
554
+
555
+ it '"2 000,01" should be parsed as 2000.01 ' do
556
+ MoneyParser.parse("2 000,01").should == BigDecimal.new("2000.01")
557
+ end
558
+
559
+
560
+ it '"- 2 000,01" should be parsed as -2000.01 (negative amount)' do
561
+ MoneyParser.parse("- 2 000,01").should == BigDecimal.new("-2000.01")
562
+ end
563
+
564
+
565
+ it '"2 o00,01" should be parsed as 2000.01 (with O instead of 0)' do
566
+ MoneyParser.parse("2 o00,01").should == BigDecimal.new("2000.01")
567
+ end
568
+
569
+
570
+ it '"$2 000,01" should be parsed as 2000.01 (with a dollar sign)' do
571
+ MoneyParser.parse("$2 000,01").should == BigDecimal.new("2000.01")
572
+ end
573
+
574
+
575
+ it '"€2 000,01" should be parsed as 2000.01 (with a euro sign)' do
576
+ MoneyParser.parse("€2 000,01").should == BigDecimal.new("2000.01")
577
+ end
578
+
579
+
580
+ it '"£2 000,01" should be parsed as 2000.01 (with a pound sign)' do
581
+ MoneyParser.parse("£2 000,01").should == BigDecimal.new("2000.01")
582
+ end
583
+
584
+
585
+ it '"₤2 000,01" should be parsed as 2000.01 (with a pound sign)' do
586
+ MoneyParser.parse("₤2 000,01").should == BigDecimal.new("2000.01")
587
+ end
588
+
589
+
590
+ it '"1,222,000.01" should be parsed as 1222000.01 ' do
591
+ MoneyParser.parse("1,222,000.01").should == BigDecimal.new("1222000.01")
592
+ end
593
+
594
+
595
+ it '" - 1,222,000.01" should be parsed as -1222000.01 (negative amount)' do
596
+ MoneyParser.parse(" - 1,222,000.01").should == BigDecimal.new("-1222000.01")
597
+ end
598
+
599
+
600
+ it '"1,222,o00.01" should be parsed as 1222000.01 (with O instead of 0)' do
601
+ MoneyParser.parse("1,222,o00.01").should == BigDecimal.new("1222000.01")
602
+ end
603
+
604
+
605
+ it '"$1,222,000.01" should be parsed as 1222000.01 (with a dollar sign)' do
606
+ MoneyParser.parse("$1,222,000.01").should == BigDecimal.new("1222000.01")
607
+ end
608
+
609
+
610
+ it '"€1,222,000.01" should be parsed as 1222000.01 (with a euro sign)' do
611
+ MoneyParser.parse("€1,222,000.01").should == BigDecimal.new("1222000.01")
612
+ end
613
+
614
+
615
+ it '"£1,222,000.01" should be parsed as 1222000.01 (with a pound sign)' do
616
+ MoneyParser.parse("£1,222,000.01").should == BigDecimal.new("1222000.01")
617
+ end
618
+
619
+
620
+ it '"₤1,222,000.01" should be parsed as 1222000.01 (with a pound sign)' do
621
+ MoneyParser.parse("₤1,222,000.01").should == BigDecimal.new("1222000.01")
622
+ end
623
+
624
+
625
+ it '"1.222.000,01" should be parsed as 1222000.01 ' do
626
+ MoneyParser.parse("1.222.000,01").should == BigDecimal.new("1222000.01")
627
+ end
628
+
629
+
630
+ it '"-1.222.000,01" should be parsed as -1222000.01 (negative amount)' do
631
+ MoneyParser.parse("-1.222.000,01").should == BigDecimal.new("-1222000.01")
632
+ end
633
+
634
+
635
+ it '"1.222.o00,01" should be parsed as 1222000.01 (with O instead of 0)' do
636
+ MoneyParser.parse("1.222.o00,01").should == BigDecimal.new("1222000.01")
637
+ end
638
+
639
+
640
+ it '"$1.222.000,01" should be parsed as 1222000.01 (with a dollar sign)' do
641
+ MoneyParser.parse("$1.222.000,01").should == BigDecimal.new("1222000.01")
642
+ end
643
+
644
+
645
+ it '"€1.222.000,01" should be parsed as 1222000.01 (with a euro sign)' do
646
+ MoneyParser.parse("€1.222.000,01").should == BigDecimal.new("1222000.01")
647
+ end
648
+
649
+
650
+ it '"£1.222.000,01" should be parsed as 1222000.01 (with a pound sign)' do
651
+ MoneyParser.parse("£1.222.000,01").should == BigDecimal.new("1222000.01")
652
+ end
653
+
654
+
655
+ it '"₤1.222.000,01" should be parsed as 1222000.01 (with a pound sign)' do
656
+ MoneyParser.parse("₤1.222.000,01").should == BigDecimal.new("1222000.01")
657
+ end
658
+
659
+
660
+ it '"1 222 000.01" should be parsed as 1222000.01 ' do
661
+ MoneyParser.parse("1 222 000.01").should == BigDecimal.new("1222000.01")
662
+ end
663
+
664
+
665
+ it '" - 1 222 000.01" should be parsed as -1222000.01 (negative amount)' do
666
+ MoneyParser.parse(" - 1 222 000.01").should == BigDecimal.new("-1222000.01")
667
+ end
668
+
669
+
670
+ it '"1 222 000.o1" should be parsed as 1222000.01 (with O instead of 0)' do
671
+ MoneyParser.parse("1 222 000.o1").should == BigDecimal.new("1222000.01")
672
+ end
673
+
674
+
675
+ it '"$1 222 000.01" should be parsed as 1222000.01 (with a dollar sign)' do
676
+ MoneyParser.parse("$1 222 000.01").should == BigDecimal.new("1222000.01")
677
+ end
678
+
679
+
680
+ it '"€1 222 000.01" should be parsed as 1222000.01 (with a euro sign)' do
681
+ MoneyParser.parse("€1 222 000.01").should == BigDecimal.new("1222000.01")
682
+ end
683
+
684
+
685
+ it '"£1 222 000.01" should be parsed as 1222000.01 (with a pound sign)' do
686
+ MoneyParser.parse("£1 222 000.01").should == BigDecimal.new("1222000.01")
687
+ end
688
+
689
+
690
+ it '"₤1 222 000.01" should be parsed as 1222000.01 (with a pound sign)' do
691
+ MoneyParser.parse("₤1 222 000.01").should == BigDecimal.new("1222000.01")
692
+ end
693
+
694
+
695
+ it '"1 222 000,01" should be parsed as 1222000.01 ' do
696
+ MoneyParser.parse("1 222 000,01").should == BigDecimal.new("1222000.01")
697
+ end
698
+
699
+
700
+ it '" - 1 222 000,01" should be parsed as -1222000.01 (negative amount)' do
701
+ MoneyParser.parse(" - 1 222 000,01").should == BigDecimal.new("-1222000.01")
702
+ end
703
+
704
+
705
+ it '"1 222 000,o1" should be parsed as 1222000.01 (with O instead of 0)' do
706
+ MoneyParser.parse("1 222 000,o1").should == BigDecimal.new("1222000.01")
707
+ end
708
+
709
+
710
+ it '"$1 222 000,01" should be parsed as 1222000.01 (with a dollar sign)' do
711
+ MoneyParser.parse("$1 222 000,01").should == BigDecimal.new("1222000.01")
712
+ end
713
+
714
+
715
+ it '"€1 222 000,01" should be parsed as 1222000.01 (with a euro sign)' do
716
+ MoneyParser.parse("€1 222 000,01").should == BigDecimal.new("1222000.01")
717
+ end
718
+
719
+
720
+ it '"£1 222 000,01" should be parsed as 1222000.01 (with a pound sign)' do
721
+ MoneyParser.parse("£1 222 000,01").should == BigDecimal.new("1222000.01")
722
+ end
723
+
724
+
725
+ it '"₤1 222 000,01" should be parsed as 1222000.01 (with a pound sign)' do
726
+ MoneyParser.parse("₤1 222 000,01").should == BigDecimal.new("1222000.01")
727
+ end
728
+
729
+
730
+ it '"2,000.1" should be parsed as 2000.1 ' do
731
+ MoneyParser.parse("2,000.1").should == BigDecimal.new("2000.1")
732
+ end
733
+
734
+
735
+ it '"-2,000.1" should be parsed as -2000.1 (negative amount)' do
736
+ MoneyParser.parse("-2,000.1").should == BigDecimal.new("-2000.1")
737
+ end
738
+
739
+
740
+ it '"2,0o0.1" should be parsed as 2000.1 (with O instead of 0)' do
741
+ MoneyParser.parse("2,0o0.1").should == BigDecimal.new("2000.1")
742
+ end
743
+
744
+
745
+ it '"$2,000.1" should be parsed as 2000.1 (with a dollar sign)' do
746
+ MoneyParser.parse("$2,000.1").should == BigDecimal.new("2000.1")
747
+ end
748
+
749
+
750
+ it '"€2,000.1" should be parsed as 2000.1 (with a euro sign)' do
751
+ MoneyParser.parse("€2,000.1").should == BigDecimal.new("2000.1")
752
+ end
753
+
754
+
755
+ it '"£2,000.1" should be parsed as 2000.1 (with a pound sign)' do
756
+ MoneyParser.parse("£2,000.1").should == BigDecimal.new("2000.1")
757
+ end
758
+
759
+
760
+ it '"₤2,000.1" should be parsed as 2000.1 (with a pound sign)' do
761
+ MoneyParser.parse("₤2,000.1").should == BigDecimal.new("2000.1")
762
+ end
763
+
764
+
765
+ it '"2.000,1" should be parsed as 2000.1 ' do
766
+ MoneyParser.parse("2.000,1").should == BigDecimal.new("2000.1")
767
+ end
768
+
769
+
770
+ it '"-2.000,1" should be parsed as -2000.1 (negative amount)' do
771
+ MoneyParser.parse("-2.000,1").should == BigDecimal.new("-2000.1")
772
+ end
773
+
774
+
775
+ it '"2.o00,1" should be parsed as 2000.1 (with O instead of 0)' do
776
+ MoneyParser.parse("2.o00,1").should == BigDecimal.new("2000.1")
777
+ end
778
+
779
+
780
+ it '"$2.000,1" should be parsed as 2000.1 (with a dollar sign)' do
781
+ MoneyParser.parse("$2.000,1").should == BigDecimal.new("2000.1")
782
+ end
783
+
784
+
785
+ it '"€2.000,1" should be parsed as 2000.1 (with a euro sign)' do
786
+ MoneyParser.parse("€2.000,1").should == BigDecimal.new("2000.1")
787
+ end
788
+
789
+
790
+ it '"£2.000,1" should be parsed as 2000.1 (with a pound sign)' do
791
+ MoneyParser.parse("£2.000,1").should == BigDecimal.new("2000.1")
792
+ end
793
+
794
+
795
+ it '"₤2.000,1" should be parsed as 2000.1 (with a pound sign)' do
796
+ MoneyParser.parse("₤2.000,1").should == BigDecimal.new("2000.1")
797
+ end
798
+
799
+
800
+ it '"2 000.1" should be parsed as 2000.1 ' do
801
+ MoneyParser.parse("2 000.1").should == BigDecimal.new("2000.1")
802
+ end
803
+
804
+
805
+ it '"- 2 000.1" should be parsed as -2000.1 (negative amount)' do
806
+ MoneyParser.parse("- 2 000.1").should == BigDecimal.new("-2000.1")
807
+ end
808
+
809
+
810
+ it '"2 o00.1" should be parsed as 2000.1 (with O instead of 0)' do
811
+ MoneyParser.parse("2 o00.1").should == BigDecimal.new("2000.1")
812
+ end
813
+
814
+
815
+ it '"$2 000.1" should be parsed as 2000.1 (with a dollar sign)' do
816
+ MoneyParser.parse("$2 000.1").should == BigDecimal.new("2000.1")
817
+ end
818
+
819
+
820
+ it '"€2 000.1" should be parsed as 2000.1 (with a euro sign)' do
821
+ MoneyParser.parse("€2 000.1").should == BigDecimal.new("2000.1")
822
+ end
823
+
824
+
825
+ it '"£2 000.1" should be parsed as 2000.1 (with a pound sign)' do
826
+ MoneyParser.parse("£2 000.1").should == BigDecimal.new("2000.1")
827
+ end
828
+
829
+
830
+ it '"₤2 000.1" should be parsed as 2000.1 (with a pound sign)' do
831
+ MoneyParser.parse("₤2 000.1").should == BigDecimal.new("2000.1")
832
+ end
833
+
834
+
835
+ it '"2 000,1" should be parsed as 2000.1 ' do
836
+ MoneyParser.parse("2 000,1").should == BigDecimal.new("2000.1")
837
+ end
838
+
839
+
840
+ it '" - 2 000,1" should be parsed as -2000.1 (negative amount)' do
841
+ MoneyParser.parse(" - 2 000,1").should == BigDecimal.new("-2000.1")
842
+ end
843
+
844
+
845
+ it '"2 0o0,1" should be parsed as 2000.1 (with O instead of 0)' do
846
+ MoneyParser.parse("2 0o0,1").should == BigDecimal.new("2000.1")
847
+ end
848
+
849
+
850
+ it '"$2 000,1" should be parsed as 2000.1 (with a dollar sign)' do
851
+ MoneyParser.parse("$2 000,1").should == BigDecimal.new("2000.1")
852
+ end
853
+
854
+
855
+ it '"€2 000,1" should be parsed as 2000.1 (with a euro sign)' do
856
+ MoneyParser.parse("€2 000,1").should == BigDecimal.new("2000.1")
857
+ end
858
+
859
+
860
+ it '"£2 000,1" should be parsed as 2000.1 (with a pound sign)' do
861
+ MoneyParser.parse("£2 000,1").should == BigDecimal.new("2000.1")
862
+ end
863
+
864
+
865
+ it '"₤2 000,1" should be parsed as 2000.1 (with a pound sign)' do
866
+ MoneyParser.parse("₤2 000,1").should == BigDecimal.new("2000.1")
867
+ end
868
+
869
+
870
+ it '"1,222,000.1" should be parsed as 1222000.1 ' do
871
+ MoneyParser.parse("1,222,000.1").should == BigDecimal.new("1222000.1")
872
+ end
873
+
874
+
875
+ it '"- 1,222,000.1" should be parsed as -1222000.1 (negative amount)' do
876
+ MoneyParser.parse("- 1,222,000.1").should == BigDecimal.new("-1222000.1")
877
+ end
878
+
879
+
880
+ it '"1,222,00o.1" should be parsed as 1222000.1 (with O instead of 0)' do
881
+ MoneyParser.parse("1,222,00o.1").should == BigDecimal.new("1222000.1")
882
+ end
883
+
884
+
885
+ it '"$1,222,000.1" should be parsed as 1222000.1 (with a dollar sign)' do
886
+ MoneyParser.parse("$1,222,000.1").should == BigDecimal.new("1222000.1")
887
+ end
888
+
889
+
890
+ it '"€1,222,000.1" should be parsed as 1222000.1 (with a euro sign)' do
891
+ MoneyParser.parse("€1,222,000.1").should == BigDecimal.new("1222000.1")
892
+ end
893
+
894
+
895
+ it '"£1,222,000.1" should be parsed as 1222000.1 (with a pound sign)' do
896
+ MoneyParser.parse("£1,222,000.1").should == BigDecimal.new("1222000.1")
897
+ end
898
+
899
+
900
+ it '"₤1,222,000.1" should be parsed as 1222000.1 (with a pound sign)' do
901
+ MoneyParser.parse("₤1,222,000.1").should == BigDecimal.new("1222000.1")
902
+ end
903
+
904
+
905
+ it '"1.222.000,1" should be parsed as 1222000.1 ' do
906
+ MoneyParser.parse("1.222.000,1").should == BigDecimal.new("1222000.1")
907
+ end
908
+
909
+
910
+ it '"- 1.222.000,1" should be parsed as -1222000.1 (negative amount)' do
911
+ MoneyParser.parse("- 1.222.000,1").should == BigDecimal.new("-1222000.1")
912
+ end
913
+
914
+
915
+ it '"1.222.0o0,1" should be parsed as 1222000.1 (with O instead of 0)' do
916
+ MoneyParser.parse("1.222.0o0,1").should == BigDecimal.new("1222000.1")
917
+ end
918
+
919
+
920
+ it '"$1.222.000,1" should be parsed as 1222000.1 (with a dollar sign)' do
921
+ MoneyParser.parse("$1.222.000,1").should == BigDecimal.new("1222000.1")
922
+ end
923
+
924
+
925
+ it '"€1.222.000,1" should be parsed as 1222000.1 (with a euro sign)' do
926
+ MoneyParser.parse("€1.222.000,1").should == BigDecimal.new("1222000.1")
927
+ end
928
+
929
+
930
+ it '"£1.222.000,1" should be parsed as 1222000.1 (with a pound sign)' do
931
+ MoneyParser.parse("£1.222.000,1").should == BigDecimal.new("1222000.1")
932
+ end
933
+
934
+
935
+ it '"₤1.222.000,1" should be parsed as 1222000.1 (with a pound sign)' do
936
+ MoneyParser.parse("₤1.222.000,1").should == BigDecimal.new("1222000.1")
937
+ end
938
+
939
+
940
+ it '"1 222 000.1" should be parsed as 1222000.1 ' do
941
+ MoneyParser.parse("1 222 000.1").should == BigDecimal.new("1222000.1")
942
+ end
943
+
944
+
945
+ it '" - 1 222 000.1" should be parsed as -1222000.1 (negative amount)' do
946
+ MoneyParser.parse(" - 1 222 000.1").should == BigDecimal.new("-1222000.1")
947
+ end
948
+
949
+
950
+ it '"1 222 00o.1" should be parsed as 1222000.1 (with O instead of 0)' do
951
+ MoneyParser.parse("1 222 00o.1").should == BigDecimal.new("1222000.1")
952
+ end
953
+
954
+
955
+ it '"$1 222 000.1" should be parsed as 1222000.1 (with a dollar sign)' do
956
+ MoneyParser.parse("$1 222 000.1").should == BigDecimal.new("1222000.1")
957
+ end
958
+
959
+
960
+ it '"€1 222 000.1" should be parsed as 1222000.1 (with a euro sign)' do
961
+ MoneyParser.parse("€1 222 000.1").should == BigDecimal.new("1222000.1")
962
+ end
963
+
964
+
965
+ it '"£1 222 000.1" should be parsed as 1222000.1 (with a pound sign)' do
966
+ MoneyParser.parse("£1 222 000.1").should == BigDecimal.new("1222000.1")
967
+ end
968
+
969
+
970
+ it '"₤1 222 000.1" should be parsed as 1222000.1 (with a pound sign)' do
971
+ MoneyParser.parse("₤1 222 000.1").should == BigDecimal.new("1222000.1")
972
+ end
973
+
974
+
975
+ it '"1 222 000,1" should be parsed as 1222000.1 ' do
976
+ MoneyParser.parse("1 222 000,1").should == BigDecimal.new("1222000.1")
977
+ end
978
+
979
+
980
+ it '" - 1 222 000,1" should be parsed as -1222000.1 (negative amount)' do
981
+ MoneyParser.parse(" - 1 222 000,1").should == BigDecimal.new("-1222000.1")
982
+ end
983
+
984
+
985
+ it '"1 222 00o,1" should be parsed as 1222000.1 (with O instead of 0)' do
986
+ MoneyParser.parse("1 222 00o,1").should == BigDecimal.new("1222000.1")
987
+ end
988
+
989
+
990
+ it '"$1 222 000,1" should be parsed as 1222000.1 (with a dollar sign)' do
991
+ MoneyParser.parse("$1 222 000,1").should == BigDecimal.new("1222000.1")
992
+ end
993
+
994
+
995
+ it '"€1 222 000,1" should be parsed as 1222000.1 (with a euro sign)' do
996
+ MoneyParser.parse("€1 222 000,1").should == BigDecimal.new("1222000.1")
997
+ end
998
+
999
+
1000
+ it '"£1 222 000,1" should be parsed as 1222000.1 (with a pound sign)' do
1001
+ MoneyParser.parse("£1 222 000,1").should == BigDecimal.new("1222000.1")
1002
+ end
1003
+
1004
+
1005
+ it '"₤1 222 000,1" should be parsed as 1222000.1 (with a pound sign)' do
1006
+ MoneyParser.parse("₤1 222 000,1").should == BigDecimal.new("1222000.1")
1007
+ end
1008
+
1009
+
1010
+ it '"2,000.10" should be parsed as 2000.1 ' do
1011
+ MoneyParser.parse("2,000.10").should == BigDecimal.new("2000.1")
1012
+ end
1013
+
1014
+
1015
+ it '"- 2,000.10" should be parsed as -2000.1 (negative amount)' do
1016
+ MoneyParser.parse("- 2,000.10").should == BigDecimal.new("-2000.1")
1017
+ end
1018
+
1019
+
1020
+ it '"2,000.1o" should be parsed as 2000.1 (with O instead of 0)' do
1021
+ MoneyParser.parse("2,000.1o").should == BigDecimal.new("2000.1")
1022
+ end
1023
+
1024
+
1025
+ it '"$2,000.10" should be parsed as 2000.1 (with a dollar sign)' do
1026
+ MoneyParser.parse("$2,000.10").should == BigDecimal.new("2000.1")
1027
+ end
1028
+
1029
+
1030
+ it '"€2,000.10" should be parsed as 2000.1 (with a euro sign)' do
1031
+ MoneyParser.parse("€2,000.10").should == BigDecimal.new("2000.1")
1032
+ end
1033
+
1034
+
1035
+ it '"£2,000.10" should be parsed as 2000.1 (with a pound sign)' do
1036
+ MoneyParser.parse("£2,000.10").should == BigDecimal.new("2000.1")
1037
+ end
1038
+
1039
+
1040
+ it '"₤2,000.10" should be parsed as 2000.1 (with a pound sign)' do
1041
+ MoneyParser.parse("₤2,000.10").should == BigDecimal.new("2000.1")
1042
+ end
1043
+
1044
+
1045
+ it '"2.000,10" should be parsed as 2000.1 ' do
1046
+ MoneyParser.parse("2.000,10").should == BigDecimal.new("2000.1")
1047
+ end
1048
+
1049
+
1050
+ it '"- 2.000,10" should be parsed as -2000.1 (negative amount)' do
1051
+ MoneyParser.parse("- 2.000,10").should == BigDecimal.new("-2000.1")
1052
+ end
1053
+
1054
+
1055
+ it '"2.00o,10" should be parsed as 2000.1 (with O instead of 0)' do
1056
+ MoneyParser.parse("2.00o,10").should == BigDecimal.new("2000.1")
1057
+ end
1058
+
1059
+
1060
+ it '"$2.000,10" should be parsed as 2000.1 (with a dollar sign)' do
1061
+ MoneyParser.parse("$2.000,10").should == BigDecimal.new("2000.1")
1062
+ end
1063
+
1064
+
1065
+ it '"€2.000,10" should be parsed as 2000.1 (with a euro sign)' do
1066
+ MoneyParser.parse("€2.000,10").should == BigDecimal.new("2000.1")
1067
+ end
1068
+
1069
+
1070
+ it '"£2.000,10" should be parsed as 2000.1 (with a pound sign)' do
1071
+ MoneyParser.parse("£2.000,10").should == BigDecimal.new("2000.1")
1072
+ end
1073
+
1074
+
1075
+ it '"₤2.000,10" should be parsed as 2000.1 (with a pound sign)' do
1076
+ MoneyParser.parse("₤2.000,10").should == BigDecimal.new("2000.1")
1077
+ end
1078
+
1079
+
1080
+ it '"2 000.10" should be parsed as 2000.1 ' do
1081
+ MoneyParser.parse("2 000.10").should == BigDecimal.new("2000.1")
1082
+ end
1083
+
1084
+
1085
+ it '"- 2 000.10" should be parsed as -2000.1 (negative amount)' do
1086
+ MoneyParser.parse("- 2 000.10").should == BigDecimal.new("-2000.1")
1087
+ end
1088
+
1089
+
1090
+ it '"2 o00.10" should be parsed as 2000.1 (with O instead of 0)' do
1091
+ MoneyParser.parse("2 o00.10").should == BigDecimal.new("2000.1")
1092
+ end
1093
+
1094
+
1095
+ it '"$2 000.10" should be parsed as 2000.1 (with a dollar sign)' do
1096
+ MoneyParser.parse("$2 000.10").should == BigDecimal.new("2000.1")
1097
+ end
1098
+
1099
+
1100
+ it '"€2 000.10" should be parsed as 2000.1 (with a euro sign)' do
1101
+ MoneyParser.parse("€2 000.10").should == BigDecimal.new("2000.1")
1102
+ end
1103
+
1104
+
1105
+ it '"£2 000.10" should be parsed as 2000.1 (with a pound sign)' do
1106
+ MoneyParser.parse("£2 000.10").should == BigDecimal.new("2000.1")
1107
+ end
1108
+
1109
+
1110
+ it '"₤2 000.10" should be parsed as 2000.1 (with a pound sign)' do
1111
+ MoneyParser.parse("₤2 000.10").should == BigDecimal.new("2000.1")
1112
+ end
1113
+
1114
+
1115
+ it '"2 000,10" should be parsed as 2000.1 ' do
1116
+ MoneyParser.parse("2 000,10").should == BigDecimal.new("2000.1")
1117
+ end
1118
+
1119
+
1120
+ it '" - 2 000,10" should be parsed as -2000.1 (negative amount)' do
1121
+ MoneyParser.parse(" - 2 000,10").should == BigDecimal.new("-2000.1")
1122
+ end
1123
+
1124
+
1125
+ it '"2 000,1o" should be parsed as 2000.1 (with O instead of 0)' do
1126
+ MoneyParser.parse("2 000,1o").should == BigDecimal.new("2000.1")
1127
+ end
1128
+
1129
+
1130
+ it '"$2 000,10" should be parsed as 2000.1 (with a dollar sign)' do
1131
+ MoneyParser.parse("$2 000,10").should == BigDecimal.new("2000.1")
1132
+ end
1133
+
1134
+
1135
+ it '"€2 000,10" should be parsed as 2000.1 (with a euro sign)' do
1136
+ MoneyParser.parse("€2 000,10").should == BigDecimal.new("2000.1")
1137
+ end
1138
+
1139
+
1140
+ it '"£2 000,10" should be parsed as 2000.1 (with a pound sign)' do
1141
+ MoneyParser.parse("£2 000,10").should == BigDecimal.new("2000.1")
1142
+ end
1143
+
1144
+
1145
+ it '"₤2 000,10" should be parsed as 2000.1 (with a pound sign)' do
1146
+ MoneyParser.parse("₤2 000,10").should == BigDecimal.new("2000.1")
1147
+ end
1148
+
1149
+
1150
+ it '"1,222,000.10" should be parsed as 1222000.1 ' do
1151
+ MoneyParser.parse("1,222,000.10").should == BigDecimal.new("1222000.1")
1152
+ end
1153
+
1154
+
1155
+ it '" - 1,222,000.10" should be parsed as -1222000.1 (negative amount)' do
1156
+ MoneyParser.parse(" - 1,222,000.10").should == BigDecimal.new("-1222000.1")
1157
+ end
1158
+
1159
+
1160
+ it '"1,222,000.1o" should be parsed as 1222000.1 (with O instead of 0)' do
1161
+ MoneyParser.parse("1,222,000.1o").should == BigDecimal.new("1222000.1")
1162
+ end
1163
+
1164
+
1165
+ it '"$1,222,000.10" should be parsed as 1222000.1 (with a dollar sign)' do
1166
+ MoneyParser.parse("$1,222,000.10").should == BigDecimal.new("1222000.1")
1167
+ end
1168
+
1169
+
1170
+ it '"€1,222,000.10" should be parsed as 1222000.1 (with a euro sign)' do
1171
+ MoneyParser.parse("€1,222,000.10").should == BigDecimal.new("1222000.1")
1172
+ end
1173
+
1174
+
1175
+ it '"£1,222,000.10" should be parsed as 1222000.1 (with a pound sign)' do
1176
+ MoneyParser.parse("£1,222,000.10").should == BigDecimal.new("1222000.1")
1177
+ end
1178
+
1179
+
1180
+ it '"₤1,222,000.10" should be parsed as 1222000.1 (with a pound sign)' do
1181
+ MoneyParser.parse("₤1,222,000.10").should == BigDecimal.new("1222000.1")
1182
+ end
1183
+
1184
+
1185
+ it '"1.222.000,10" should be parsed as 1222000.1 ' do
1186
+ MoneyParser.parse("1.222.000,10").should == BigDecimal.new("1222000.1")
1187
+ end
1188
+
1189
+
1190
+ it '"-1.222.000,10" should be parsed as -1222000.1 (negative amount)' do
1191
+ MoneyParser.parse("-1.222.000,10").should == BigDecimal.new("-1222000.1")
1192
+ end
1193
+
1194
+
1195
+ it '"1.222.00o,10" should be parsed as 1222000.1 (with O instead of 0)' do
1196
+ MoneyParser.parse("1.222.00o,10").should == BigDecimal.new("1222000.1")
1197
+ end
1198
+
1199
+
1200
+ it '"$1.222.000,10" should be parsed as 1222000.1 (with a dollar sign)' do
1201
+ MoneyParser.parse("$1.222.000,10").should == BigDecimal.new("1222000.1")
1202
+ end
1203
+
1204
+
1205
+ it '"€1.222.000,10" should be parsed as 1222000.1 (with a euro sign)' do
1206
+ MoneyParser.parse("€1.222.000,10").should == BigDecimal.new("1222000.1")
1207
+ end
1208
+
1209
+
1210
+ it '"£1.222.000,10" should be parsed as 1222000.1 (with a pound sign)' do
1211
+ MoneyParser.parse("£1.222.000,10").should == BigDecimal.new("1222000.1")
1212
+ end
1213
+
1214
+
1215
+ it '"₤1.222.000,10" should be parsed as 1222000.1 (with a pound sign)' do
1216
+ MoneyParser.parse("₤1.222.000,10").should == BigDecimal.new("1222000.1")
1217
+ end
1218
+
1219
+
1220
+ it '"1 222 000.10" should be parsed as 1222000.1 ' do
1221
+ MoneyParser.parse("1 222 000.10").should == BigDecimal.new("1222000.1")
1222
+ end
1223
+
1224
+
1225
+ it '" -1 222 000.10" should be parsed as -1222000.1 (negative amount)' do
1226
+ MoneyParser.parse(" -1 222 000.10").should == BigDecimal.new("-1222000.1")
1227
+ end
1228
+
1229
+
1230
+ it '"1 222 0o0.10" should be parsed as 1222000.1 (with O instead of 0)' do
1231
+ MoneyParser.parse("1 222 0o0.10").should == BigDecimal.new("1222000.1")
1232
+ end
1233
+
1234
+
1235
+ it '"$1 222 000.10" should be parsed as 1222000.1 (with a dollar sign)' do
1236
+ MoneyParser.parse("$1 222 000.10").should == BigDecimal.new("1222000.1")
1237
+ end
1238
+
1239
+
1240
+ it '"€1 222 000.10" should be parsed as 1222000.1 (with a euro sign)' do
1241
+ MoneyParser.parse("€1 222 000.10").should == BigDecimal.new("1222000.1")
1242
+ end
1243
+
1244
+
1245
+ it '"£1 222 000.10" should be parsed as 1222000.1 (with a pound sign)' do
1246
+ MoneyParser.parse("£1 222 000.10").should == BigDecimal.new("1222000.1")
1247
+ end
1248
+
1249
+
1250
+ it '"₤1 222 000.10" should be parsed as 1222000.1 (with a pound sign)' do
1251
+ MoneyParser.parse("₤1 222 000.10").should == BigDecimal.new("1222000.1")
1252
+ end
1253
+
1254
+
1255
+ it '"1 222 000,10" should be parsed as 1222000.1 ' do
1256
+ MoneyParser.parse("1 222 000,10").should == BigDecimal.new("1222000.1")
1257
+ end
1258
+
1259
+
1260
+ it '" -1 222 000,10" should be parsed as -1222000.1 (negative amount)' do
1261
+ MoneyParser.parse(" -1 222 000,10").should == BigDecimal.new("-1222000.1")
1262
+ end
1263
+
1264
+
1265
+ it '"1 222 o00,10" should be parsed as 1222000.1 (with O instead of 0)' do
1266
+ MoneyParser.parse("1 222 o00,10").should == BigDecimal.new("1222000.1")
1267
+ end
1268
+
1269
+
1270
+ it '"$1 222 000,10" should be parsed as 1222000.1 (with a dollar sign)' do
1271
+ MoneyParser.parse("$1 222 000,10").should == BigDecimal.new("1222000.1")
1272
+ end
1273
+
1274
+
1275
+ it '"€1 222 000,10" should be parsed as 1222000.1 (with a euro sign)' do
1276
+ MoneyParser.parse("€1 222 000,10").should == BigDecimal.new("1222000.1")
1277
+ end
1278
+
1279
+
1280
+ it '"£1 222 000,10" should be parsed as 1222000.1 (with a pound sign)' do
1281
+ MoneyParser.parse("£1 222 000,10").should == BigDecimal.new("1222000.1")
1282
+ end
1283
+
1284
+
1285
+ it '"₤1 222 000,10" should be parsed as 1222000.1 (with a pound sign)' do
1286
+ MoneyParser.parse("₤1 222 000,10").should == BigDecimal.new("1222000.1")
1287
+ end
1288
+
1289
+
1290
+ it '"1 222 000" should be parsed as 1222000.0 ' do
1291
+ MoneyParser.parse("1 222 000").should == BigDecimal.new("1222000.0")
1292
+ end
1293
+
1294
+
1295
+ it '"-1 222 000" should be parsed as -1222000.0 (negative amount)' do
1296
+ MoneyParser.parse("-1 222 000").should == BigDecimal.new("-1222000.0")
1297
+ end
1298
+
1299
+
1300
+ it '"1 222 o00" should be parsed as 1222000.0 (with O instead of 0)' do
1301
+ MoneyParser.parse("1 222 o00").should == BigDecimal.new("1222000.0")
1302
+ end
1303
+
1304
+
1305
+ it '"$1 222 000" should be parsed as 1222000.0 (with a dollar sign)' do
1306
+ MoneyParser.parse("$1 222 000").should == BigDecimal.new("1222000.0")
1307
+ end
1308
+
1309
+
1310
+ it '"€1 222 000" should be parsed as 1222000.0 (with a euro sign)' do
1311
+ MoneyParser.parse("€1 222 000").should == BigDecimal.new("1222000.0")
1312
+ end
1313
+
1314
+
1315
+ it '"£1 222 000" should be parsed as 1222000.0 (with a pound sign)' do
1316
+ MoneyParser.parse("£1 222 000").should == BigDecimal.new("1222000.0")
1317
+ end
1318
+
1319
+
1320
+ it '"₤1 222 000" should be parsed as 1222000.0 (with a pound sign)' do
1321
+ MoneyParser.parse("₤1 222 000").should == BigDecimal.new("1222000.0")
1322
+ end
1323
+
1324
+
1325
+ it '"1 222 000" should be parsed as 1222000.0 ' do
1326
+ MoneyParser.parse("1 222 000").should == BigDecimal.new("1222000.0")
1327
+ end
1328
+
1329
+
1330
+ it '"- 1 222 000" should be parsed as -1222000.0 (negative amount)' do
1331
+ MoneyParser.parse("- 1 222 000").should == BigDecimal.new("-1222000.0")
1332
+ end
1333
+
1334
+
1335
+ it '"1 222 00o" should be parsed as 1222000.0 (with O instead of 0)' do
1336
+ MoneyParser.parse("1 222 00o").should == BigDecimal.new("1222000.0")
1337
+ end
1338
+
1339
+
1340
+ it '"$1 222 000" should be parsed as 1222000.0 (with a dollar sign)' do
1341
+ MoneyParser.parse("$1 222 000").should == BigDecimal.new("1222000.0")
1342
+ end
1343
+
1344
+
1345
+ it '"€1 222 000" should be parsed as 1222000.0 (with a euro sign)' do
1346
+ MoneyParser.parse("€1 222 000").should == BigDecimal.new("1222000.0")
1347
+ end
1348
+
1349
+
1350
+ it '"£1 222 000" should be parsed as 1222000.0 (with a pound sign)' do
1351
+ MoneyParser.parse("£1 222 000").should == BigDecimal.new("1222000.0")
1352
+ end
1353
+
1354
+
1355
+ it '"₤1 222 000" should be parsed as 1222000.0 (with a pound sign)' do
1356
+ MoneyParser.parse("₤1 222 000").should == BigDecimal.new("1222000.0")
1357
+ end
1358
+
1359
+
1360
+ it '"1,222,000" should be parsed as 1222000.0 ' do
1361
+ MoneyParser.parse("1,222,000").should == BigDecimal.new("1222000.0")
1362
+ end
1363
+
1364
+
1365
+ it '" - 1,222,000" should be parsed as -1222000.0 (negative amount)' do
1366
+ MoneyParser.parse(" - 1,222,000").should == BigDecimal.new("-1222000.0")
1367
+ end
1368
+
1369
+
1370
+ it '"1,222,0o0" should be parsed as 1222000.0 (with O instead of 0)' do
1371
+ MoneyParser.parse("1,222,0o0").should == BigDecimal.new("1222000.0")
1372
+ end
1373
+
1374
+
1375
+ it '"$1,222,000" should be parsed as 1222000.0 (with a dollar sign)' do
1376
+ MoneyParser.parse("$1,222,000").should == BigDecimal.new("1222000.0")
1377
+ end
1378
+
1379
+
1380
+ it '"€1,222,000" should be parsed as 1222000.0 (with a euro sign)' do
1381
+ MoneyParser.parse("€1,222,000").should == BigDecimal.new("1222000.0")
1382
+ end
1383
+
1384
+
1385
+ it '"£1,222,000" should be parsed as 1222000.0 (with a pound sign)' do
1386
+ MoneyParser.parse("£1,222,000").should == BigDecimal.new("1222000.0")
1387
+ end
1388
+
1389
+
1390
+ it '"₤1,222,000" should be parsed as 1222000.0 (with a pound sign)' do
1391
+ MoneyParser.parse("₤1,222,000").should == BigDecimal.new("1222000.0")
1392
+ end
1393
+
1394
+
1395
+ it '"1.222.000" should be parsed as 1222000.0 ' do
1396
+ MoneyParser.parse("1.222.000").should == BigDecimal.new("1222000.0")
1397
+ end
1398
+
1399
+
1400
+ it '" -1.222.000" should be parsed as -1222000.0 (negative amount)' do
1401
+ MoneyParser.parse(" -1.222.000").should == BigDecimal.new("-1222000.0")
1402
+ end
1403
+
1404
+
1405
+ it '"1.222.o00" should be parsed as 1222000.0 (with O instead of 0)' do
1406
+ MoneyParser.parse("1.222.o00").should == BigDecimal.new("1222000.0")
1407
+ end
1408
+
1409
+
1410
+ it '"$1.222.000" should be parsed as 1222000.0 (with a dollar sign)' do
1411
+ MoneyParser.parse("$1.222.000").should == BigDecimal.new("1222000.0")
1412
+ end
1413
+
1414
+
1415
+ it '"€1.222.000" should be parsed as 1222000.0 (with a euro sign)' do
1416
+ MoneyParser.parse("€1.222.000").should == BigDecimal.new("1222000.0")
1417
+ end
1418
+
1419
+
1420
+ it '"£1.222.000" should be parsed as 1222000.0 (with a pound sign)' do
1421
+ MoneyParser.parse("£1.222.000").should == BigDecimal.new("1222000.0")
1422
+ end
1423
+
1424
+
1425
+ it '"₤1.222.000" should be parsed as 1222000.0 (with a pound sign)' do
1426
+ MoneyParser.parse("₤1.222.000").should == BigDecimal.new("1222000.0")
1427
+ end
1428
+
1429
+
1430
+ it '"1 222 000" should be parsed as 1222000.0 ' do
1431
+ MoneyParser.parse("1 222 000").should == BigDecimal.new("1222000.0")
1432
+ end
1433
+
1434
+
1435
+ it '" -1 222 000" should be parsed as -1222000.0 (negative amount)' do
1436
+ MoneyParser.parse(" -1 222 000").should == BigDecimal.new("-1222000.0")
1437
+ end
1438
+
1439
+
1440
+ it '"1 222 o00" should be parsed as 1222000.0 (with O instead of 0)' do
1441
+ MoneyParser.parse("1 222 o00").should == BigDecimal.new("1222000.0")
1442
+ end
1443
+
1444
+
1445
+ it '"$1 222 000" should be parsed as 1222000.0 (with a dollar sign)' do
1446
+ MoneyParser.parse("$1 222 000").should == BigDecimal.new("1222000.0")
1447
+ end
1448
+
1449
+
1450
+ it '"€1 222 000" should be parsed as 1222000.0 (with a euro sign)' do
1451
+ MoneyParser.parse("€1 222 000").should == BigDecimal.new("1222000.0")
1452
+ end
1453
+
1454
+
1455
+ it '"£1 222 000" should be parsed as 1222000.0 (with a pound sign)' do
1456
+ MoneyParser.parse("£1 222 000").should == BigDecimal.new("1222000.0")
1457
+ end
1458
+
1459
+
1460
+ it '"₤1 222 000" should be parsed as 1222000.0 (with a pound sign)' do
1461
+ MoneyParser.parse("₤1 222 000").should == BigDecimal.new("1222000.0")
1462
+ end
1463
+
1464
+
1465
+ it '"1 222 000" should be parsed as 1222000.0 ' do
1466
+ MoneyParser.parse("1 222 000").should == BigDecimal.new("1222000.0")
1467
+ end
1468
+
1469
+
1470
+ it '"- 1 222 000" should be parsed as -1222000.0 (negative amount)' do
1471
+ MoneyParser.parse("- 1 222 000").should == BigDecimal.new("-1222000.0")
1472
+ end
1473
+
1474
+
1475
+ it '"1 222 00o" should be parsed as 1222000.0 (with O instead of 0)' do
1476
+ MoneyParser.parse("1 222 00o").should == BigDecimal.new("1222000.0")
1477
+ end
1478
+
1479
+
1480
+ it '"$1 222 000" should be parsed as 1222000.0 (with a dollar sign)' do
1481
+ MoneyParser.parse("$1 222 000").should == BigDecimal.new("1222000.0")
1482
+ end
1483
+
1484
+
1485
+ it '"€1 222 000" should be parsed as 1222000.0 (with a euro sign)' do
1486
+ MoneyParser.parse("€1 222 000").should == BigDecimal.new("1222000.0")
1487
+ end
1488
+
1489
+
1490
+ it '"£1 222 000" should be parsed as 1222000.0 (with a pound sign)' do
1491
+ MoneyParser.parse("£1 222 000").should == BigDecimal.new("1222000.0")
1492
+ end
1493
+
1494
+
1495
+ it '"₤1 222 000" should be parsed as 1222000.0 (with a pound sign)' do
1496
+ MoneyParser.parse("₤1 222 000").should == BigDecimal.new("1222000.0")
1497
+ end
1498
+
1499
+
1500
+ it '"2,123" should be parsed as 2123.0 ' do
1501
+ MoneyParser.parse("2,123").should == BigDecimal.new("2123.0")
1502
+ end
1503
+
1504
+
1505
+ it '"- 2,123" should be parsed as -2123.0 (negative amount)' do
1506
+ MoneyParser.parse("- 2,123").should == BigDecimal.new("-2123.0")
1507
+ end
1508
+
1509
+
1510
+ it '"$2,123" should be parsed as 2123.0 (with a dollar sign)' do
1511
+ MoneyParser.parse("$2,123").should == BigDecimal.new("2123.0")
1512
+ end
1513
+
1514
+
1515
+ it '"€2,123" should be parsed as 2123.0 (with a euro sign)' do
1516
+ MoneyParser.parse("€2,123").should == BigDecimal.new("2123.0")
1517
+ end
1518
+
1519
+
1520
+ it '"£2,123" should be parsed as 2123.0 (with a pound sign)' do
1521
+ MoneyParser.parse("£2,123").should == BigDecimal.new("2123.0")
1522
+ end
1523
+
1524
+
1525
+ it '"₤2,123" should be parsed as 2123.0 (with a pound sign)' do
1526
+ MoneyParser.parse("₤2,123").should == BigDecimal.new("2123.0")
1527
+ end
1528
+
1529
+
1530
+ it '"2.123" should be parsed as 2123.0 ' do
1531
+ MoneyParser.parse("2.123").should == BigDecimal.new("2123.0")
1532
+ end
1533
+
1534
+
1535
+ it '" - 2.123" should be parsed as -2123.0 (negative amount)' do
1536
+ MoneyParser.parse(" - 2.123").should == BigDecimal.new("-2123.0")
1537
+ end
1538
+
1539
+
1540
+ it '"$2.123" should be parsed as 2123.0 (with a dollar sign)' do
1541
+ MoneyParser.parse("$2.123").should == BigDecimal.new("2123.0")
1542
+ end
1543
+
1544
+
1545
+ it '"€2.123" should be parsed as 2123.0 (with a euro sign)' do
1546
+ MoneyParser.parse("€2.123").should == BigDecimal.new("2123.0")
1547
+ end
1548
+
1549
+
1550
+ it '"£2.123" should be parsed as 2123.0 (with a pound sign)' do
1551
+ MoneyParser.parse("£2.123").should == BigDecimal.new("2123.0")
1552
+ end
1553
+
1554
+
1555
+ it '"₤2.123" should be parsed as 2123.0 (with a pound sign)' do
1556
+ MoneyParser.parse("₤2.123").should == BigDecimal.new("2123.0")
1557
+ end
1558
+
1559
+
1560
+ it '"2,12" should be parsed as 2.12 ' do
1561
+ MoneyParser.parse("2,12").should == BigDecimal.new("2.12")
1562
+ end
1563
+
1564
+
1565
+ it '"- 2,12" should be parsed as -2.12 (negative amount)' do
1566
+ MoneyParser.parse("- 2,12").should == BigDecimal.new("-2.12")
1567
+ end
1568
+
1569
+
1570
+ it '"$2,12" should be parsed as 2.12 (with a dollar sign)' do
1571
+ MoneyParser.parse("$2,12").should == BigDecimal.new("2.12")
1572
+ end
1573
+
1574
+
1575
+ it '"€2,12" should be parsed as 2.12 (with a euro sign)' do
1576
+ MoneyParser.parse("€2,12").should == BigDecimal.new("2.12")
1577
+ end
1578
+
1579
+
1580
+ it '"£2,12" should be parsed as 2.12 (with a pound sign)' do
1581
+ MoneyParser.parse("£2,12").should == BigDecimal.new("2.12")
1582
+ end
1583
+
1584
+
1585
+ it '"₤2,12" should be parsed as 2.12 (with a pound sign)' do
1586
+ MoneyParser.parse("₤2,12").should == BigDecimal.new("2.12")
1587
+ end
1588
+
1589
+
1590
+ it '"" should be parsed as nil ' do
1591
+ MoneyParser.parse("").should == nil
1592
+ end
1593
+
1594
+
1595
+ it '"$" should be parsed as nil (with a dollar sign)' do
1596
+ MoneyParser.parse("$").should == nil
1597
+ end
1598
+
1599
+
1600
+ it '"€" should be parsed as nil (with a euro sign)' do
1601
+ MoneyParser.parse("€").should == nil
1602
+ end
1603
+
1604
+
1605
+ it '"£" should be parsed as nil (with a pound sign)' do
1606
+ MoneyParser.parse("£").should == nil
1607
+ end
1608
+
1609
+
1610
+ it '"₤" should be parsed as nil (with a pound sign)' do
1611
+ MoneyParser.parse("₤").should == nil
1612
+ end
1613
+
1614
+
1615
+ it '"1" should be parsed as 1.0 ' do
1616
+ MoneyParser.parse("1").should == BigDecimal.new("1.0")
1617
+ end
1618
+
1619
+
1620
+ it '" - 1" should be parsed as -1.0 (negative amount)' do
1621
+ MoneyParser.parse(" - 1").should == BigDecimal.new("-1.0")
1622
+ end
1623
+
1624
+
1625
+ it '"$1" should be parsed as 1.0 (with a dollar sign)' do
1626
+ MoneyParser.parse("$1").should == BigDecimal.new("1.0")
1627
+ end
1628
+
1629
+
1630
+ it '"€1" should be parsed as 1.0 (with a euro sign)' do
1631
+ MoneyParser.parse("€1").should == BigDecimal.new("1.0")
1632
+ end
1633
+
1634
+
1635
+ it '"£1" should be parsed as 1.0 (with a pound sign)' do
1636
+ MoneyParser.parse("£1").should == BigDecimal.new("1.0")
1637
+ end
1638
+
1639
+
1640
+ it '"₤1" should be parsed as 1.0 (with a pound sign)' do
1641
+ MoneyParser.parse("₤1").should == BigDecimal.new("1.0")
1642
+ end
1643
+
1644
+
1645
+ it '" " should be parsed as nil ' do
1646
+ MoneyParser.parse(" ").should == nil
1647
+ end
1648
+
1649
+
1650
+ it '"$ " should be parsed as nil (with a dollar sign)' do
1651
+ MoneyParser.parse("$ ").should == nil
1652
+ end
1653
+
1654
+
1655
+ it '"€ " should be parsed as nil (with a euro sign)' do
1656
+ MoneyParser.parse("€ ").should == nil
1657
+ end
1658
+
1659
+
1660
+ it '"£ " should be parsed as nil (with a pound sign)' do
1661
+ MoneyParser.parse("£ ").should == nil
1662
+ end
1663
+
1664
+
1665
+ it '"₤ " should be parsed as nil (with a pound sign)' do
1666
+ MoneyParser.parse("₤ ").should == nil
1667
+ end
1668
+
1669
+
1670
+ it '"hello" should be parsed as nil ' do
1671
+ MoneyParser.parse("hello").should == nil
1672
+ end
1673
+
1674
+
1675
+ it '"$hello" should be parsed as nil (with a dollar sign)' do
1676
+ MoneyParser.parse("$hello").should == nil
1677
+ end
1678
+
1679
+
1680
+ it '"€hello" should be parsed as nil (with a euro sign)' do
1681
+ MoneyParser.parse("€hello").should == nil
1682
+ end
1683
+
1684
+
1685
+ it '"£hello" should be parsed as nil (with a pound sign)' do
1686
+ MoneyParser.parse("£hello").should == nil
1687
+ end
1688
+
1689
+
1690
+ it '"₤hello" should be parsed as nil (with a pound sign)' do
1691
+ MoneyParser.parse("₤hello").should == nil
1692
+ end
1693
+ end