blackbox 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -0
- data/README.md +1 -1
- data/blackbox.gemspec +1 -0
- data/coverage/.resultset.json +1 -146
- data/coverage/index.html +8 -942
- data/doc/BB/Crypto.html +1 -1
- data/doc/BB/Hash.html +1 -1
- data/doc/BB/String.html +1 -1
- data/doc/BB.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +2 -2
- data/doc/index.html +2 -2
- data/doc/top-level-namespace.html +1 -1
- data/lib/blackbox/hash.rb +3 -3
- data/lib/blackbox/version.rb +1 -1
- data/spec/spec_helper.rb +3 -1
- metadata +29 -15
data/coverage/index.html
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
<img src="./assets/0.7.1/loading.gif" alt="loading"/>
|
15
15
|
</div>
|
16
16
|
<div id="wrapper" style="display:none;">
|
17
|
-
<div class="timestamp">Generated <abbr class="timeago" title="
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2014-12-24T05:23:14+01:00">2014-12-24T05:23:14+01:00</abbr></div>
|
18
18
|
<ul class="group_tabs"></ul>
|
19
19
|
|
20
20
|
<div id="content">
|
@@ -25,15 +25,15 @@
|
|
25
25
|
covered at
|
26
26
|
<span class="covered_strength">
|
27
27
|
<span class="green">
|
28
|
-
|
28
|
+
81.7
|
29
29
|
</span>
|
30
30
|
</span> hits/line)
|
31
31
|
</h2>
|
32
32
|
<a name="AllFiles"></a>
|
33
33
|
<div>
|
34
|
-
<b>
|
35
|
-
<b>
|
36
|
-
<span class="green"><b>
|
34
|
+
<b>3</b> files in total.
|
35
|
+
<b>50</b> relevant lines.
|
36
|
+
<span class="green"><b>50</b> lines covered</span> and
|
37
37
|
<span class="red"><b>0</b> lines missed </span>
|
38
38
|
</div>
|
39
39
|
<table class="file_list">
|
@@ -80,46 +80,6 @@
|
|
80
80
|
<td>1.0</td>
|
81
81
|
</tr>
|
82
82
|
|
83
|
-
<tr>
|
84
|
-
<td class="strong"><a href="#b4c16bd67a1a4fce8b02ba44abacd0ec0257943d" class="src_link" title="lib/blackbox/version.rb">lib/blackbox/version.rb</a></td>
|
85
|
-
<td class="green strong">100.0 %</td>
|
86
|
-
<td>3</td>
|
87
|
-
<td>2</td>
|
88
|
-
<td>2</td>
|
89
|
-
<td>0</td>
|
90
|
-
<td>1.0</td>
|
91
|
-
</tr>
|
92
|
-
|
93
|
-
<tr>
|
94
|
-
<td class="strong"><a href="#f22e54c644ee98f4bae1e03f860b6a6d7765aa2a" class="src_link" title="spec/crypto_spec.rb">spec/crypto_spec.rb</a></td>
|
95
|
-
<td class="green strong">100.0 %</td>
|
96
|
-
<td>70</td>
|
97
|
-
<td>38</td>
|
98
|
-
<td>38</td>
|
99
|
-
<td>0</td>
|
100
|
-
<td>69.3</td>
|
101
|
-
</tr>
|
102
|
-
|
103
|
-
<tr>
|
104
|
-
<td class="strong"><a href="#76591dc79921e23b5067ff22c00caff4f35ddc25" class="src_link" title="spec/hash_spec.rb">spec/hash_spec.rb</a></td>
|
105
|
-
<td class="green strong">100.0 %</td>
|
106
|
-
<td>51</td>
|
107
|
-
<td>17</td>
|
108
|
-
<td>17</td>
|
109
|
-
<td>0</td>
|
110
|
-
<td>1.0</td>
|
111
|
-
</tr>
|
112
|
-
|
113
|
-
<tr>
|
114
|
-
<td class="strong"><a href="#f0f2a0640dc412383156f37da73a9a143a48fe1b" class="src_link" title="spec/string_spec.rb">spec/string_spec.rb</a></td>
|
115
|
-
<td class="green strong">100.0 %</td>
|
116
|
-
<td>13</td>
|
117
|
-
<td>8</td>
|
118
|
-
<td>8</td>
|
119
|
-
<td>0</td>
|
120
|
-
<td>1.0</td>
|
121
|
-
</tr>
|
122
|
-
|
123
83
|
</tbody>
|
124
84
|
</table>
|
125
85
|
</div>
|
@@ -783,7 +743,7 @@
|
|
783
743
|
<li class="covered" data-hits="1" data-linenumber="4">
|
784
744
|
<span class="hits">1</span>
|
785
745
|
|
786
|
-
<code class="ruby"> class << self
|
746
|
+
<code class="ruby"> class << self</code>
|
787
747
|
</li>
|
788
748
|
|
789
749
|
<li class="never" data-hits="" data-linenumber="5">
|
@@ -963,7 +923,7 @@
|
|
963
923
|
<li class="covered" data-hits="22" data-linenumber="34">
|
964
924
|
<span class="hits">22</span>
|
965
925
|
|
966
|
-
<code class="ruby"> key = opts[:prefix].nil? ? "#{key}" : "#{opts[:prefix]}#{opts[:delimiter]
|
926
|
+
<code class="ruby"> key = opts[:prefix].nil? ? "#{key}" : "#{opts[:prefix]}#{opts[:delimiter]||'.'}#{key}"</code>
|
967
927
|
</li>
|
968
928
|
|
969
929
|
<li class="covered" data-hits="22" data-linenumber="35">
|
@@ -981,7 +941,7 @@
|
|
981
941
|
<li class="covered" data-hits="9" data-linenumber="37">
|
982
942
|
<span class="hits">9</span>
|
983
943
|
|
984
|
-
<code class="ruby"> flatten_prop_style(value, {:prefix => key
|
944
|
+
<code class="ruby"> flatten_prop_style(value, opts.merge({:prefix => key}), output)</code>
|
985
945
|
</li>
|
986
946
|
|
987
947
|
<li class="never" data-hits="" data-linenumber="38">
|
@@ -1180,900 +1140,6 @@
|
|
1180
1140
|
</pre>
|
1181
1141
|
</div>
|
1182
1142
|
|
1183
|
-
<div class="source_table" id="b4c16bd67a1a4fce8b02ba44abacd0ec0257943d">
|
1184
|
-
<div class="header">
|
1185
|
-
<h3>lib/blackbox/version.rb</h3>
|
1186
|
-
<h4><span class="green">100.0 %</span> covered</h4>
|
1187
|
-
<div>
|
1188
|
-
<b>2</b> relevant lines.
|
1189
|
-
<span class="green"><b>2</b> lines covered</span> and
|
1190
|
-
<span class="red"><b>0</b> lines missed.</span>
|
1191
|
-
</div>
|
1192
|
-
</div>
|
1193
|
-
|
1194
|
-
<pre>
|
1195
|
-
<ol>
|
1196
|
-
|
1197
|
-
<li class="covered" data-hits="1" data-linenumber="1">
|
1198
|
-
<span class="hits">1</span>
|
1199
|
-
|
1200
|
-
<code class="ruby">module BB</code>
|
1201
|
-
</li>
|
1202
|
-
|
1203
|
-
<li class="covered" data-hits="1" data-linenumber="2">
|
1204
|
-
<span class="hits">1</span>
|
1205
|
-
|
1206
|
-
<code class="ruby"> VERSION = "1.0.0"</code>
|
1207
|
-
</li>
|
1208
|
-
|
1209
|
-
<li class="never" data-hits="" data-linenumber="3">
|
1210
|
-
|
1211
|
-
|
1212
|
-
<code class="ruby">end</code>
|
1213
|
-
</li>
|
1214
|
-
|
1215
|
-
</ol>
|
1216
|
-
</pre>
|
1217
|
-
</div>
|
1218
|
-
|
1219
|
-
<div class="source_table" id="f22e54c644ee98f4bae1e03f860b6a6d7765aa2a">
|
1220
|
-
<div class="header">
|
1221
|
-
<h3>spec/crypto_spec.rb</h3>
|
1222
|
-
<h4><span class="green">100.0 %</span> covered</h4>
|
1223
|
-
<div>
|
1224
|
-
<b>38</b> relevant lines.
|
1225
|
-
<span class="green"><b>38</b> lines covered</span> and
|
1226
|
-
<span class="red"><b>0</b> lines missed.</span>
|
1227
|
-
</div>
|
1228
|
-
</div>
|
1229
|
-
|
1230
|
-
<pre>
|
1231
|
-
<ol>
|
1232
|
-
|
1233
|
-
<li class="covered" data-hits="1" data-linenumber="1">
|
1234
|
-
<span class="hits">1</span>
|
1235
|
-
|
1236
|
-
<code class="ruby">require 'spec_helper'</code>
|
1237
|
-
</li>
|
1238
|
-
|
1239
|
-
<li class="covered" data-hits="1" data-linenumber="2">
|
1240
|
-
<span class="hits">1</span>
|
1241
|
-
|
1242
|
-
<code class="ruby">require 'blackbox/crypto'</code>
|
1243
|
-
</li>
|
1244
|
-
|
1245
|
-
<li class="covered" data-hits="1" data-linenumber="3">
|
1246
|
-
<span class="hits">1</span>
|
1247
|
-
|
1248
|
-
<code class="ruby">require 'base64'</code>
|
1249
|
-
</li>
|
1250
|
-
|
1251
|
-
<li class="never" data-hits="" data-linenumber="4">
|
1252
|
-
|
1253
|
-
|
1254
|
-
<code class="ruby"></code>
|
1255
|
-
</li>
|
1256
|
-
|
1257
|
-
<li class="covered" data-hits="1" data-linenumber="5">
|
1258
|
-
<span class="hits">1</span>
|
1259
|
-
|
1260
|
-
<code class="ruby">OPENSSL_CIPHERS = %w[aes-128-cbc aes-128-ecb aes-192-cbc aes-192-ecb aes-256-cbc]+</code>
|
1261
|
-
</li>
|
1262
|
-
|
1263
|
-
<li class="never" data-hits="" data-linenumber="6">
|
1264
|
-
|
1265
|
-
|
1266
|
-
<code class="ruby"> %w[aes-256-ecb bf bf-cbc bf-cfb]+</code>
|
1267
|
-
</li>
|
1268
|
-
|
1269
|
-
<li class="never" data-hits="" data-linenumber="7">
|
1270
|
-
|
1271
|
-
|
1272
|
-
<code class="ruby"> %w[bf-ecb bf-ofb cast cast-cbc cast5-cbc]+</code>
|
1273
|
-
</li>
|
1274
|
-
|
1275
|
-
<li class="never" data-hits="" data-linenumber="8">
|
1276
|
-
|
1277
|
-
|
1278
|
-
<code class="ruby"> %w[cast5-cfb cast5-ecb cast5-ofb des des-cbc]+</code>
|
1279
|
-
</li>
|
1280
|
-
|
1281
|
-
<li class="never" data-hits="" data-linenumber="9">
|
1282
|
-
|
1283
|
-
|
1284
|
-
<code class="ruby"> %w[des-cfb des-ecb des-ede des-ede-cbc des-ede-cfb]+</code>
|
1285
|
-
</li>
|
1286
|
-
|
1287
|
-
<li class="never" data-hits="" data-linenumber="10">
|
1288
|
-
|
1289
|
-
|
1290
|
-
<code class="ruby"> %w[des-ede-ofb des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb]+</code>
|
1291
|
-
</li>
|
1292
|
-
|
1293
|
-
<li class="never" data-hits="" data-linenumber="11">
|
1294
|
-
|
1295
|
-
|
1296
|
-
<code class="ruby"> %w[des-ofb des3 desx rc2 rc2-40-cbc]+</code>
|
1297
|
-
</li>
|
1298
|
-
|
1299
|
-
<li class="never" data-hits="" data-linenumber="12">
|
1300
|
-
|
1301
|
-
|
1302
|
-
<code class="ruby"> %w[rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb]+</code>
|
1303
|
-
</li>
|
1304
|
-
|
1305
|
-
<li class="never" data-hits="" data-linenumber="13">
|
1306
|
-
|
1307
|
-
|
1308
|
-
<code class="ruby"> %w[rc4 rc4-40]</code>
|
1309
|
-
</li>
|
1310
|
-
|
1311
|
-
<li class="never" data-hits="" data-linenumber="14">
|
1312
|
-
|
1313
|
-
|
1314
|
-
<code class="ruby"></code>
|
1315
|
-
</li>
|
1316
|
-
|
1317
|
-
<li class="covered" data-hits="1" data-linenumber="15">
|
1318
|
-
<span class="hits">1</span>
|
1319
|
-
|
1320
|
-
<code class="ruby">TEST_KEY='12345678901234567890123456789012'</code>
|
1321
|
-
</li>
|
1322
|
-
|
1323
|
-
<li class="covered" data-hits="1" data-linenumber="16">
|
1324
|
-
<span class="hits">1</span>
|
1325
|
-
|
1326
|
-
<code class="ruby">TEST_IV ='x234567890123456789012345678901x'</code>
|
1327
|
-
</li>
|
1328
|
-
|
1329
|
-
<li class="covered" data-hits="1" data-linenumber="17">
|
1330
|
-
<span class="hits">1</span>
|
1331
|
-
|
1332
|
-
<code class="ruby">TEST_TEXT_SHORT='[SHORT_TEST]'*16</code>
|
1333
|
-
</li>
|
1334
|
-
|
1335
|
-
<li class="covered" data-hits="1" data-linenumber="18">
|
1336
|
-
<span class="hits">1</span>
|
1337
|
-
|
1338
|
-
<code class="ruby">TEST_TEXT_LONG='[LONG_TEST]'*8192</code>
|
1339
|
-
</li>
|
1340
|
-
|
1341
|
-
<li class="never" data-hits="" data-linenumber="19">
|
1342
|
-
|
1343
|
-
|
1344
|
-
<code class="ruby"></code>
|
1345
|
-
</li>
|
1346
|
-
|
1347
|
-
<li class="covered" data-hits="1" data-linenumber="20">
|
1348
|
-
<span class="hits">1</span>
|
1349
|
-
|
1350
|
-
<code class="ruby">describe BB::Crypto do</code>
|
1351
|
-
</li>
|
1352
|
-
|
1353
|
-
<li class="covered" data-hits="1" data-linenumber="21">
|
1354
|
-
<span class="hits">1</span>
|
1355
|
-
|
1356
|
-
<code class="ruby"> OPENSSL_CIPHERS.each do |cipher|</code>
|
1357
|
-
</li>
|
1358
|
-
|
1359
|
-
<li class="covered" data-hits="41" data-linenumber="22">
|
1360
|
-
<span class="hits">41</span>
|
1361
|
-
|
1362
|
-
<code class="ruby"> describe "#{cipher}" do</code>
|
1363
|
-
</li>
|
1364
|
-
|
1365
|
-
<li class="never" data-hits="" data-linenumber="23">
|
1366
|
-
|
1367
|
-
|
1368
|
-
<code class="ruby"> [[:encrypt, :decrypt],</code>
|
1369
|
-
</li>
|
1370
|
-
|
1371
|
-
<li class="never" data-hits="" data-linenumber="24">
|
1372
|
-
|
1373
|
-
|
1374
|
-
<code class="ruby"> [:encrypt_base64, :decrypt_base64],</code>
|
1375
|
-
</li>
|
1376
|
-
|
1377
|
-
<li class="covered" data-hits="41" data-linenumber="25">
|
1378
|
-
<span class="hits">41</span>
|
1379
|
-
|
1380
|
-
<code class="ruby"> [:encrypt_urlsafe_base64, :decrypt_urlsafe_base64]].each do |e|</code>
|
1381
|
-
</li>
|
1382
|
-
|
1383
|
-
<li class="covered" data-hits="123" data-linenumber="26">
|
1384
|
-
<span class="hits">123</span>
|
1385
|
-
|
1386
|
-
<code class="ruby"> m_enc, m_dec = e</code>
|
1387
|
-
</li>
|
1388
|
-
|
1389
|
-
<li class="covered" data-hits="123" data-linenumber="27">
|
1390
|
-
<span class="hits">123</span>
|
1391
|
-
|
1392
|
-
<code class="ruby"> describe "#{m_enc}, #{m_dec}" do</code>
|
1393
|
-
</li>
|
1394
|
-
|
1395
|
-
<li class="covered" data-hits="123" data-linenumber="28">
|
1396
|
-
<span class="hits">123</span>
|
1397
|
-
|
1398
|
-
<code class="ruby"> it "can decrypt what it encrypted (short string, random iv)" do</code>
|
1399
|
-
</li>
|
1400
|
-
|
1401
|
-
<li class="covered" data-hits="123" data-linenumber="29">
|
1402
|
-
<span class="hits">123</span>
|
1403
|
-
|
1404
|
-
<code class="ruby"> ct = BB::Crypto.send(m_enc, TEST_TEXT_SHORT, TEST_KEY, cipher)</code>
|
1405
|
-
</li>
|
1406
|
-
|
1407
|
-
<li class="covered" data-hits="123" data-linenumber="30">
|
1408
|
-
<span class="hits">123</span>
|
1409
|
-
|
1410
|
-
<code class="ruby"> pt = BB::Crypto.send(m_dec, ct, TEST_KEY, cipher)</code>
|
1411
|
-
</li>
|
1412
|
-
|
1413
|
-
<li class="covered" data-hits="123" data-linenumber="31">
|
1414
|
-
<span class="hits">123</span>
|
1415
|
-
|
1416
|
-
<code class="ruby"> pt.should == TEST_TEXT_SHORT</code>
|
1417
|
-
</li>
|
1418
|
-
|
1419
|
-
<li class="never" data-hits="" data-linenumber="32">
|
1420
|
-
|
1421
|
-
|
1422
|
-
<code class="ruby"> end</code>
|
1423
|
-
</li>
|
1424
|
-
|
1425
|
-
<li class="never" data-hits="" data-linenumber="33">
|
1426
|
-
|
1427
|
-
|
1428
|
-
<code class="ruby"></code>
|
1429
|
-
</li>
|
1430
|
-
|
1431
|
-
<li class="covered" data-hits="123" data-linenumber="34">
|
1432
|
-
<span class="hits">123</span>
|
1433
|
-
|
1434
|
-
<code class="ruby"> it "can decrypt what it encrypted (long string, random iv)" do</code>
|
1435
|
-
</li>
|
1436
|
-
|
1437
|
-
<li class="covered" data-hits="123" data-linenumber="35">
|
1438
|
-
<span class="hits">123</span>
|
1439
|
-
|
1440
|
-
<code class="ruby"> ct = BB::Crypto.send(m_enc, TEST_TEXT_LONG, TEST_KEY, cipher)</code>
|
1441
|
-
</li>
|
1442
|
-
|
1443
|
-
<li class="covered" data-hits="123" data-linenumber="36">
|
1444
|
-
<span class="hits">123</span>
|
1445
|
-
|
1446
|
-
<code class="ruby"> pt = BB::Crypto.send(m_dec, ct, TEST_KEY, cipher)</code>
|
1447
|
-
</li>
|
1448
|
-
|
1449
|
-
<li class="covered" data-hits="123" data-linenumber="37">
|
1450
|
-
<span class="hits">123</span>
|
1451
|
-
|
1452
|
-
<code class="ruby"> pt.should == TEST_TEXT_LONG</code>
|
1453
|
-
</li>
|
1454
|
-
|
1455
|
-
<li class="never" data-hits="" data-linenumber="38">
|
1456
|
-
|
1457
|
-
|
1458
|
-
<code class="ruby"> end</code>
|
1459
|
-
</li>
|
1460
|
-
|
1461
|
-
<li class="never" data-hits="" data-linenumber="39">
|
1462
|
-
|
1463
|
-
|
1464
|
-
<code class="ruby"></code>
|
1465
|
-
</li>
|
1466
|
-
|
1467
|
-
<li class="covered" data-hits="123" data-linenumber="40">
|
1468
|
-
<span class="hits">123</span>
|
1469
|
-
|
1470
|
-
<code class="ruby"> it "can decrypt what it encrypted (long string, static iv)" do</code>
|
1471
|
-
</li>
|
1472
|
-
|
1473
|
-
<li class="covered" data-hits="123" data-linenumber="41">
|
1474
|
-
<span class="hits">123</span>
|
1475
|
-
|
1476
|
-
<code class="ruby"> ct = BB::Crypto.send(m_enc, TEST_TEXT_LONG, TEST_KEY, cipher, TEST_IV)</code>
|
1477
|
-
</li>
|
1478
|
-
|
1479
|
-
<li class="covered" data-hits="123" data-linenumber="42">
|
1480
|
-
<span class="hits">123</span>
|
1481
|
-
|
1482
|
-
<code class="ruby"> pt = BB::Crypto.send(m_dec, ct, TEST_KEY, cipher, TEST_IV)</code>
|
1483
|
-
</li>
|
1484
|
-
|
1485
|
-
<li class="covered" data-hits="123" data-linenumber="43">
|
1486
|
-
<span class="hits">123</span>
|
1487
|
-
|
1488
|
-
<code class="ruby"> pt.should == TEST_TEXT_LONG</code>
|
1489
|
-
</li>
|
1490
|
-
|
1491
|
-
<li class="never" data-hits="" data-linenumber="44">
|
1492
|
-
|
1493
|
-
|
1494
|
-
<code class="ruby"> end</code>
|
1495
|
-
</li>
|
1496
|
-
|
1497
|
-
<li class="never" data-hits="" data-linenumber="45">
|
1498
|
-
|
1499
|
-
|
1500
|
-
<code class="ruby"></code>
|
1501
|
-
</li>
|
1502
|
-
|
1503
|
-
<li class="covered" data-hits="123" data-linenumber="46">
|
1504
|
-
<span class="hits">123</span>
|
1505
|
-
|
1506
|
-
<code class="ruby"> it "returns consistent output with static iv" do</code>
|
1507
|
-
</li>
|
1508
|
-
|
1509
|
-
<li class="covered" data-hits="123" data-linenumber="47">
|
1510
|
-
<span class="hits">123</span>
|
1511
|
-
|
1512
|
-
<code class="ruby"> a = BB::Crypto.send(m_enc, TEST_TEXT_SHORT, TEST_KEY, cipher, TEST_IV)</code>
|
1513
|
-
</li>
|
1514
|
-
|
1515
|
-
<li class="covered" data-hits="123" data-linenumber="48">
|
1516
|
-
<span class="hits">123</span>
|
1517
|
-
|
1518
|
-
<code class="ruby"> b = BB::Crypto.send(m_enc, TEST_TEXT_SHORT, TEST_KEY, cipher, TEST_IV)</code>
|
1519
|
-
</li>
|
1520
|
-
|
1521
|
-
<li class="covered" data-hits="123" data-linenumber="49">
|
1522
|
-
<span class="hits">123</span>
|
1523
|
-
|
1524
|
-
<code class="ruby"> a.should == b</code>
|
1525
|
-
</li>
|
1526
|
-
|
1527
|
-
<li class="never" data-hits="" data-linenumber="50">
|
1528
|
-
|
1529
|
-
|
1530
|
-
<code class="ruby"> end</code>
|
1531
|
-
</li>
|
1532
|
-
|
1533
|
-
<li class="never" data-hits="" data-linenumber="51">
|
1534
|
-
|
1535
|
-
|
1536
|
-
<code class="ruby"> end</code>
|
1537
|
-
</li>
|
1538
|
-
|
1539
|
-
<li class="never" data-hits="" data-linenumber="52">
|
1540
|
-
|
1541
|
-
|
1542
|
-
<code class="ruby"> end</code>
|
1543
|
-
</li>
|
1544
|
-
|
1545
|
-
<li class="never" data-hits="" data-linenumber="53">
|
1546
|
-
|
1547
|
-
|
1548
|
-
<code class="ruby"></code>
|
1549
|
-
</li>
|
1550
|
-
|
1551
|
-
<li class="covered" data-hits="41" data-linenumber="54">
|
1552
|
-
<span class="hits">41</span>
|
1553
|
-
|
1554
|
-
<code class="ruby"> describe "encrypt_base64" do</code>
|
1555
|
-
</li>
|
1556
|
-
|
1557
|
-
<li class="covered" data-hits="41" data-linenumber="55">
|
1558
|
-
<span class="hits">41</span>
|
1559
|
-
|
1560
|
-
<code class="ruby"> it "returns base64 string" do</code>
|
1561
|
-
</li>
|
1562
|
-
|
1563
|
-
<li class="covered" data-hits="41" data-linenumber="56">
|
1564
|
-
<span class="hits">41</span>
|
1565
|
-
|
1566
|
-
<code class="ruby"> ct = BB::Crypto.encrypt_base64(TEST_TEXT_LONG, TEST_KEY)</code>
|
1567
|
-
</li>
|
1568
|
-
|
1569
|
-
<li class="covered" data-hits="41" data-linenumber="57">
|
1570
|
-
<span class="hits">41</span>
|
1571
|
-
|
1572
|
-
<code class="ruby"> Base64.decode64(ct)</code>
|
1573
|
-
</li>
|
1574
|
-
|
1575
|
-
<li class="never" data-hits="" data-linenumber="58">
|
1576
|
-
|
1577
|
-
|
1578
|
-
<code class="ruby"> end</code>
|
1579
|
-
</li>
|
1580
|
-
|
1581
|
-
<li class="never" data-hits="" data-linenumber="59">
|
1582
|
-
|
1583
|
-
|
1584
|
-
<code class="ruby"> end</code>
|
1585
|
-
</li>
|
1586
|
-
|
1587
|
-
<li class="never" data-hits="" data-linenumber="60">
|
1588
|
-
|
1589
|
-
|
1590
|
-
<code class="ruby"></code>
|
1591
|
-
</li>
|
1592
|
-
|
1593
|
-
<li class="covered" data-hits="41" data-linenumber="61">
|
1594
|
-
<span class="hits">41</span>
|
1595
|
-
|
1596
|
-
<code class="ruby"> describe "encrypt_urlsafe_base64" do</code>
|
1597
|
-
</li>
|
1598
|
-
|
1599
|
-
<li class="covered" data-hits="41" data-linenumber="62">
|
1600
|
-
<span class="hits">41</span>
|
1601
|
-
|
1602
|
-
<code class="ruby"> it "returns urlsafe base64 string" do</code>
|
1603
|
-
</li>
|
1604
|
-
|
1605
|
-
<li class="covered" data-hits="41" data-linenumber="63">
|
1606
|
-
<span class="hits">41</span>
|
1607
|
-
|
1608
|
-
<code class="ruby"> ct = BB::Crypto.encrypt_urlsafe_base64(TEST_TEXT_LONG, TEST_KEY)</code>
|
1609
|
-
</li>
|
1610
|
-
|
1611
|
-
<li class="covered" data-hits="41" data-linenumber="64">
|
1612
|
-
<span class="hits">41</span>
|
1613
|
-
|
1614
|
-
<code class="ruby"> Base64.urlsafe_decode64(ct)</code>
|
1615
|
-
</li>
|
1616
|
-
|
1617
|
-
<li class="never" data-hits="" data-linenumber="65">
|
1618
|
-
|
1619
|
-
|
1620
|
-
<code class="ruby"> end</code>
|
1621
|
-
</li>
|
1622
|
-
|
1623
|
-
<li class="never" data-hits="" data-linenumber="66">
|
1624
|
-
|
1625
|
-
|
1626
|
-
<code class="ruby"> end</code>
|
1627
|
-
</li>
|
1628
|
-
|
1629
|
-
<li class="never" data-hits="" data-linenumber="67">
|
1630
|
-
|
1631
|
-
|
1632
|
-
<code class="ruby"> end</code>
|
1633
|
-
</li>
|
1634
|
-
|
1635
|
-
<li class="never" data-hits="" data-linenumber="68">
|
1636
|
-
|
1637
|
-
|
1638
|
-
<code class="ruby"> end</code>
|
1639
|
-
</li>
|
1640
|
-
|
1641
|
-
<li class="never" data-hits="" data-linenumber="69">
|
1642
|
-
|
1643
|
-
|
1644
|
-
<code class="ruby">end</code>
|
1645
|
-
</li>
|
1646
|
-
|
1647
|
-
<li class="never" data-hits="" data-linenumber="70">
|
1648
|
-
|
1649
|
-
|
1650
|
-
<code class="ruby"></code>
|
1651
|
-
</li>
|
1652
|
-
|
1653
|
-
</ol>
|
1654
|
-
</pre>
|
1655
|
-
</div>
|
1656
|
-
|
1657
|
-
<div class="source_table" id="76591dc79921e23b5067ff22c00caff4f35ddc25">
|
1658
|
-
<div class="header">
|
1659
|
-
<h3>spec/hash_spec.rb</h3>
|
1660
|
-
<h4><span class="green">100.0 %</span> covered</h4>
|
1661
|
-
<div>
|
1662
|
-
<b>17</b> relevant lines.
|
1663
|
-
<span class="green"><b>17</b> lines covered</span> and
|
1664
|
-
<span class="red"><b>0</b> lines missed.</span>
|
1665
|
-
</div>
|
1666
|
-
</div>
|
1667
|
-
|
1668
|
-
<pre>
|
1669
|
-
<ol>
|
1670
|
-
|
1671
|
-
<li class="covered" data-hits="1" data-linenumber="1">
|
1672
|
-
<span class="hits">1</span>
|
1673
|
-
|
1674
|
-
<code class="ruby">require 'spec_helper'</code>
|
1675
|
-
</li>
|
1676
|
-
|
1677
|
-
<li class="covered" data-hits="1" data-linenumber="2">
|
1678
|
-
<span class="hits">1</span>
|
1679
|
-
|
1680
|
-
<code class="ruby">require 'blackbox/hash'</code>
|
1681
|
-
</li>
|
1682
|
-
|
1683
|
-
<li class="never" data-hits="" data-linenumber="3">
|
1684
|
-
|
1685
|
-
|
1686
|
-
<code class="ruby"></code>
|
1687
|
-
</li>
|
1688
|
-
|
1689
|
-
<li class="covered" data-hits="1" data-linenumber="4">
|
1690
|
-
<span class="hits">1</span>
|
1691
|
-
|
1692
|
-
<code class="ruby">describe BB::Hash do</code>
|
1693
|
-
</li>
|
1694
|
-
|
1695
|
-
<li class="covered" data-hits="1" data-linenumber="5">
|
1696
|
-
<span class="hits">1</span>
|
1697
|
-
|
1698
|
-
<code class="ruby"> describe '.symbolize_keys' do</code>
|
1699
|
-
</li>
|
1700
|
-
|
1701
|
-
<li class="covered" data-hits="1" data-linenumber="6">
|
1702
|
-
<span class="hits">1</span>
|
1703
|
-
|
1704
|
-
<code class="ruby"> it "turns all keys into symbols" do</code>
|
1705
|
-
</li>
|
1706
|
-
|
1707
|
-
<li class="covered" data-hits="1" data-linenumber="7">
|
1708
|
-
<span class="hits">1</span>
|
1709
|
-
|
1710
|
-
<code class="ruby"> have = { 'foo' => 1, :bar => 2, 'batz' => 3 }</code>
|
1711
|
-
</li>
|
1712
|
-
|
1713
|
-
<li class="covered" data-hits="1" data-linenumber="8">
|
1714
|
-
<span class="hits">1</span>
|
1715
|
-
|
1716
|
-
<code class="ruby"> want = { :foo => 1, :bar => 2, :batz => 3 }</code>
|
1717
|
-
</li>
|
1718
|
-
|
1719
|
-
<li class="covered" data-hits="1" data-linenumber="9">
|
1720
|
-
<span class="hits">1</span>
|
1721
|
-
|
1722
|
-
<code class="ruby"> BB::Hash.symbolize_keys(have).should == want</code>
|
1723
|
-
</li>
|
1724
|
-
|
1725
|
-
<li class="never" data-hits="" data-linenumber="10">
|
1726
|
-
|
1727
|
-
|
1728
|
-
<code class="ruby"> end</code>
|
1729
|
-
</li>
|
1730
|
-
|
1731
|
-
<li class="never" data-hits="" data-linenumber="11">
|
1732
|
-
|
1733
|
-
|
1734
|
-
<code class="ruby"></code>
|
1735
|
-
</li>
|
1736
|
-
|
1737
|
-
<li class="covered" data-hits="1" data-linenumber="12">
|
1738
|
-
<span class="hits">1</span>
|
1739
|
-
|
1740
|
-
<code class="ruby"> it "raises NoMethodError when #to_sym fails for a key" do</code>
|
1741
|
-
</li>
|
1742
|
-
|
1743
|
-
<li class="covered" data-hits="1" data-linenumber="13">
|
1744
|
-
<span class="hits">1</span>
|
1745
|
-
|
1746
|
-
<code class="ruby"> lambda {</code>
|
1747
|
-
</li>
|
1748
|
-
|
1749
|
-
<li class="covered" data-hits="1" data-linenumber="14">
|
1750
|
-
<span class="hits">1</span>
|
1751
|
-
|
1752
|
-
<code class="ruby"> have = { 'foo' => 1, 2 => 2, :bar => 3 }</code>
|
1753
|
-
</li>
|
1754
|
-
|
1755
|
-
<li class="covered" data-hits="1" data-linenumber="15">
|
1756
|
-
<span class="hits">1</span>
|
1757
|
-
|
1758
|
-
<code class="ruby"> BB::Hash.symbolize_keys(have)</code>
|
1759
|
-
</li>
|
1760
|
-
|
1761
|
-
<li class="never" data-hits="" data-linenumber="16">
|
1762
|
-
|
1763
|
-
|
1764
|
-
<code class="ruby"> }.should raise_error NoMethodError</code>
|
1765
|
-
</li>
|
1766
|
-
|
1767
|
-
<li class="never" data-hits="" data-linenumber="17">
|
1768
|
-
|
1769
|
-
|
1770
|
-
<code class="ruby"> end</code>
|
1771
|
-
</li>
|
1772
|
-
|
1773
|
-
<li class="never" data-hits="" data-linenumber="18">
|
1774
|
-
|
1775
|
-
|
1776
|
-
<code class="ruby"> end</code>
|
1777
|
-
</li>
|
1778
|
-
|
1779
|
-
<li class="never" data-hits="" data-linenumber="19">
|
1780
|
-
|
1781
|
-
|
1782
|
-
<code class="ruby"></code>
|
1783
|
-
</li>
|
1784
|
-
|
1785
|
-
<li class="covered" data-hits="1" data-linenumber="20">
|
1786
|
-
<span class="hits">1</span>
|
1787
|
-
|
1788
|
-
<code class="ruby"> describe ".flatten_prop_style" do</code>
|
1789
|
-
</li>
|
1790
|
-
|
1791
|
-
<li class="covered" data-hits="1" data-linenumber="21">
|
1792
|
-
<span class="hits">1</span>
|
1793
|
-
|
1794
|
-
<code class="ruby"> it "returns flattened hash" do</code>
|
1795
|
-
</li>
|
1796
|
-
|
1797
|
-
<li class="covered" data-hits="1" data-linenumber="22">
|
1798
|
-
<span class="hits">1</span>
|
1799
|
-
|
1800
|
-
<code class="ruby"> have = {</code>
|
1801
|
-
</li>
|
1802
|
-
|
1803
|
-
<li class="never" data-hits="" data-linenumber="23">
|
1804
|
-
|
1805
|
-
|
1806
|
-
<code class="ruby"> :a=> 1,</code>
|
1807
|
-
</li>
|
1808
|
-
|
1809
|
-
<li class="never" data-hits="" data-linenumber="24">
|
1810
|
-
|
1811
|
-
|
1812
|
-
<code class="ruby"> 'b' => 2,</code>
|
1813
|
-
</li>
|
1814
|
-
|
1815
|
-
<li class="never" data-hits="" data-linenumber="25">
|
1816
|
-
|
1817
|
-
|
1818
|
-
<code class="ruby"> 3 => 3,</code>
|
1819
|
-
</li>
|
1820
|
-
|
1821
|
-
<li class="never" data-hits="" data-linenumber="26">
|
1822
|
-
|
1823
|
-
|
1824
|
-
<code class="ruby"> :array => [1,2,3],</code>
|
1825
|
-
</li>
|
1826
|
-
|
1827
|
-
<li class="never" data-hits="" data-linenumber="27">
|
1828
|
-
|
1829
|
-
|
1830
|
-
<code class="ruby"> 'nested' => { 'a' => 1, :b => 2, :c => 3 },</code>
|
1831
|
-
</li>
|
1832
|
-
|
1833
|
-
<li class="never" data-hits="" data-linenumber="28">
|
1834
|
-
|
1835
|
-
|
1836
|
-
<code class="ruby"> :double_nested => { :a => { :aa => 1 }, :b => { :bb => 2 }, :c => { :cc => 3 } },</code>
|
1837
|
-
</li>
|
1838
|
-
|
1839
|
-
<li class="never" data-hits="" data-linenumber="29">
|
1840
|
-
|
1841
|
-
|
1842
|
-
<code class="ruby"> :nested_with_array => { :a => { :aa => [:a, 'b', 3] }, :b => { :bb => [:a, 'b', 3] }, :c => { :cc => [:a, 'b', 3] } }</code>
|
1843
|
-
</li>
|
1844
|
-
|
1845
|
-
<li class="never" data-hits="" data-linenumber="30">
|
1846
|
-
|
1847
|
-
|
1848
|
-
<code class="ruby"> }</code>
|
1849
|
-
</li>
|
1850
|
-
|
1851
|
-
<li class="never" data-hits="" data-linenumber="31">
|
1852
|
-
|
1853
|
-
|
1854
|
-
<code class="ruby"></code>
|
1855
|
-
</li>
|
1856
|
-
|
1857
|
-
<li class="covered" data-hits="1" data-linenumber="32">
|
1858
|
-
<span class="hits">1</span>
|
1859
|
-
|
1860
|
-
<code class="ruby"> want = {</code>
|
1861
|
-
</li>
|
1862
|
-
|
1863
|
-
<li class="never" data-hits="" data-linenumber="33">
|
1864
|
-
|
1865
|
-
|
1866
|
-
<code class="ruby"> "a"=>1,</code>
|
1867
|
-
</li>
|
1868
|
-
|
1869
|
-
<li class="never" data-hits="" data-linenumber="34">
|
1870
|
-
|
1871
|
-
|
1872
|
-
<code class="ruby"> "b"=>2,</code>
|
1873
|
-
</li>
|
1874
|
-
|
1875
|
-
<li class="never" data-hits="" data-linenumber="35">
|
1876
|
-
|
1877
|
-
|
1878
|
-
<code class="ruby"> "3"=>3,</code>
|
1879
|
-
</li>
|
1880
|
-
|
1881
|
-
<li class="never" data-hits="" data-linenumber="36">
|
1882
|
-
|
1883
|
-
|
1884
|
-
<code class="ruby"> "array"=>"1,2,3",</code>
|
1885
|
-
</li>
|
1886
|
-
|
1887
|
-
<li class="never" data-hits="" data-linenumber="37">
|
1888
|
-
|
1889
|
-
|
1890
|
-
<code class="ruby"> "nested.a"=>1,</code>
|
1891
|
-
</li>
|
1892
|
-
|
1893
|
-
<li class="never" data-hits="" data-linenumber="38">
|
1894
|
-
|
1895
|
-
|
1896
|
-
<code class="ruby"> "nested.b"=>2,</code>
|
1897
|
-
</li>
|
1898
|
-
|
1899
|
-
<li class="never" data-hits="" data-linenumber="39">
|
1900
|
-
|
1901
|
-
|
1902
|
-
<code class="ruby"> "nested.c"=>3,</code>
|
1903
|
-
</li>
|
1904
|
-
|
1905
|
-
<li class="never" data-hits="" data-linenumber="40">
|
1906
|
-
|
1907
|
-
|
1908
|
-
<code class="ruby"> "double_nested.a.aa"=>1,</code>
|
1909
|
-
</li>
|
1910
|
-
|
1911
|
-
<li class="never" data-hits="" data-linenumber="41">
|
1912
|
-
|
1913
|
-
|
1914
|
-
<code class="ruby"> "double_nested.b.bb"=>2,</code>
|
1915
|
-
</li>
|
1916
|
-
|
1917
|
-
<li class="never" data-hits="" data-linenumber="42">
|
1918
|
-
|
1919
|
-
|
1920
|
-
<code class="ruby"> "double_nested.c.cc"=>3,</code>
|
1921
|
-
</li>
|
1922
|
-
|
1923
|
-
<li class="never" data-hits="" data-linenumber="43">
|
1924
|
-
|
1925
|
-
|
1926
|
-
<code class="ruby"> "nested_with_array.a.aa"=>"a,b,3",</code>
|
1927
|
-
</li>
|
1928
|
-
|
1929
|
-
<li class="never" data-hits="" data-linenumber="44">
|
1930
|
-
|
1931
|
-
|
1932
|
-
<code class="ruby"> "nested_with_array.b.bb"=>"a,b,3",</code>
|
1933
|
-
</li>
|
1934
|
-
|
1935
|
-
<li class="never" data-hits="" data-linenumber="45">
|
1936
|
-
|
1937
|
-
|
1938
|
-
<code class="ruby"> "nested_with_array.c.cc"=>"a,b,3"</code>
|
1939
|
-
</li>
|
1940
|
-
|
1941
|
-
<li class="never" data-hits="" data-linenumber="46">
|
1942
|
-
|
1943
|
-
|
1944
|
-
<code class="ruby"> }</code>
|
1945
|
-
</li>
|
1946
|
-
|
1947
|
-
<li class="covered" data-hits="1" data-linenumber="47">
|
1948
|
-
<span class="hits">1</span>
|
1949
|
-
|
1950
|
-
<code class="ruby"> BB::Hash::flatten_prop_style(have).should == want</code>
|
1951
|
-
</li>
|
1952
|
-
|
1953
|
-
<li class="never" data-hits="" data-linenumber="48">
|
1954
|
-
|
1955
|
-
|
1956
|
-
<code class="ruby"> end</code>
|
1957
|
-
</li>
|
1958
|
-
|
1959
|
-
<li class="never" data-hits="" data-linenumber="49">
|
1960
|
-
|
1961
|
-
|
1962
|
-
<code class="ruby"> end</code>
|
1963
|
-
</li>
|
1964
|
-
|
1965
|
-
<li class="never" data-hits="" data-linenumber="50">
|
1966
|
-
|
1967
|
-
|
1968
|
-
<code class="ruby">end</code>
|
1969
|
-
</li>
|
1970
|
-
|
1971
|
-
<li class="never" data-hits="" data-linenumber="51">
|
1972
|
-
|
1973
|
-
|
1974
|
-
<code class="ruby"></code>
|
1975
|
-
</li>
|
1976
|
-
|
1977
|
-
</ol>
|
1978
|
-
</pre>
|
1979
|
-
</div>
|
1980
|
-
|
1981
|
-
<div class="source_table" id="f0f2a0640dc412383156f37da73a9a143a48fe1b">
|
1982
|
-
<div class="header">
|
1983
|
-
<h3>spec/string_spec.rb</h3>
|
1984
|
-
<h4><span class="green">100.0 %</span> covered</h4>
|
1985
|
-
<div>
|
1986
|
-
<b>8</b> relevant lines.
|
1987
|
-
<span class="green"><b>8</b> lines covered</span> and
|
1988
|
-
<span class="red"><b>0</b> lines missed.</span>
|
1989
|
-
</div>
|
1990
|
-
</div>
|
1991
|
-
|
1992
|
-
<pre>
|
1993
|
-
<ol>
|
1994
|
-
|
1995
|
-
<li class="covered" data-hits="1" data-linenumber="1">
|
1996
|
-
<span class="hits">1</span>
|
1997
|
-
|
1998
|
-
<code class="ruby">require 'spec_helper'</code>
|
1999
|
-
</li>
|
2000
|
-
|
2001
|
-
<li class="covered" data-hits="1" data-linenumber="2">
|
2002
|
-
<span class="hits">1</span>
|
2003
|
-
|
2004
|
-
<code class="ruby">require 'blackbox/string'</code>
|
2005
|
-
</li>
|
2006
|
-
|
2007
|
-
<li class="never" data-hits="" data-linenumber="3">
|
2008
|
-
|
2009
|
-
|
2010
|
-
<code class="ruby"></code>
|
2011
|
-
</li>
|
2012
|
-
|
2013
|
-
<li class="covered" data-hits="1" data-linenumber="4">
|
2014
|
-
<span class="hits">1</span>
|
2015
|
-
|
2016
|
-
<code class="ruby">describe BB::String do</code>
|
2017
|
-
</li>
|
2018
|
-
|
2019
|
-
<li class="covered" data-hits="1" data-linenumber="5">
|
2020
|
-
<span class="hits">1</span>
|
2021
|
-
|
2022
|
-
<code class="ruby"> describe '.strip_ansi' do</code>
|
2023
|
-
</li>
|
2024
|
-
|
2025
|
-
<li class="covered" data-hits="1" data-linenumber="6">
|
2026
|
-
<span class="hits">1</span>
|
2027
|
-
|
2028
|
-
<code class="ruby"> it "strips a few common escape sequences" do</code>
|
2029
|
-
</li>
|
2030
|
-
|
2031
|
-
<li class="covered" data-hits="1" data-linenumber="7">
|
2032
|
-
<span class="hits">1</span>
|
2033
|
-
|
2034
|
-
<code class="ruby"> have = "\e[31;1mX\e[AY\e[2JZ"</code>
|
2035
|
-
</li>
|
2036
|
-
|
2037
|
-
<li class="covered" data-hits="1" data-linenumber="8">
|
2038
|
-
<span class="hits">1</span>
|
2039
|
-
|
2040
|
-
<code class="ruby"> want = "XYZ"</code>
|
2041
|
-
</li>
|
2042
|
-
|
2043
|
-
<li class="covered" data-hits="1" data-linenumber="9">
|
2044
|
-
<span class="hits">1</span>
|
2045
|
-
|
2046
|
-
<code class="ruby"> BB::String.strip_ansi(have).should == want</code>
|
2047
|
-
</li>
|
2048
|
-
|
2049
|
-
<li class="never" data-hits="" data-linenumber="10">
|
2050
|
-
|
2051
|
-
|
2052
|
-
<code class="ruby"> end</code>
|
2053
|
-
</li>
|
2054
|
-
|
2055
|
-
<li class="never" data-hits="" data-linenumber="11">
|
2056
|
-
|
2057
|
-
|
2058
|
-
<code class="ruby"> end</code>
|
2059
|
-
</li>
|
2060
|
-
|
2061
|
-
<li class="never" data-hits="" data-linenumber="12">
|
2062
|
-
|
2063
|
-
|
2064
|
-
<code class="ruby">end</code>
|
2065
|
-
</li>
|
2066
|
-
|
2067
|
-
<li class="never" data-hits="" data-linenumber="13">
|
2068
|
-
|
2069
|
-
|
2070
|
-
<code class="ruby"></code>
|
2071
|
-
</li>
|
2072
|
-
|
2073
|
-
</ol>
|
2074
|
-
</pre>
|
2075
|
-
</div>
|
2076
|
-
|
2077
1143
|
</div>
|
2078
1144
|
</div>
|
2079
1145
|
</body>
|