rabbit-slide-kou-rubykaigi-2015 2015.12.12.0 → 2015.12.12.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f09738e0c21a01ab119e45f8498211b7d4950c05
|
4
|
+
data.tar.gz: 86be51838c6692e58ce50a3676ee4c24389b8c4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63d7aa9ca5db8f2ab1599310422a79b04274d7e6be0724ed66bfde856b694152076f3afa9f369345b1db11dd58c070de5cf984d22920edda9dc76979136fa18c
|
7
|
+
data.tar.gz: 8f27b6b110dee5df2a8be453a7c0b774c27c05b77f9fcbcf4a1f2b128d657b7a6143257d37ef45b3e9b5fc005bcef6ba84de11a3f3f6291500591c9a9174bed0
|
data/config.yaml
CHANGED
Binary file
|
@@ -73,8 +73,8 @@ Which Rubies do include\n
|
|
73
73
|
testsupp, RubyUnit
|
74
74
|
Lapidary,
|
75
75
|
Test::Unit, test/unit
|
76
|
-
test-unit,
|
77
|
-
|
76
|
+
test-unit, minitest
|
77
|
+
RSpec,
|
78
78
|
|
79
79
|
= Ruby 1.3 times\n(('note:Ruby 1.3の時代'))
|
80
80
|
|
@@ -119,6 +119,14 @@ Which Rubies do include\n
|
|
119
119
|
* The first xUnit testing framework for Ruby\n
|
120
120
|
(('note:最初のRuby用のxUnit系テスティングフレームワーク'))
|
121
121
|
|
122
|
+
= FYI: XP\n(('note:参考情報:XP'))
|
123
|
+
|
124
|
+
* eXtream Programing
|
125
|
+
* The first XP book was published at 1999\n
|
126
|
+
(('note:最初のXPの本は1999年に出版'))
|
127
|
+
* xUnit was born from XP\n
|
128
|
+
(('note:xUnitはXPが生み出した'))
|
129
|
+
|
122
130
|
= RubyUnit: API
|
123
131
|
|
124
132
|
# coderay ruby
|
@@ -247,22 +255,6 @@ Ruby-ish\n
|
|
247
255
|
# coderay ruby
|
248
256
|
require "test/unit"
|
249
257
|
|
250
|
-
= Test::Unit in Ruby 1.8\n(('note:Ruby 1.8バンドル後のTest::Unit'))
|
251
|
-
|
252
|
-
* No active development\n
|
253
|
-
(('note:開発は停滞'))
|
254
|
-
* Maintainer is changed\n
|
255
|
-
(('note:メンテナー交代'))
|
256
|
-
* The author of minitest\n
|
257
|
-
(('note:後のminitestの作者'))
|
258
|
-
|
259
|
-
= Test::Unit:\nnew maintainer\n(('note:新しいメンテナー'))
|
260
|
-
|
261
|
-
* New maintainer said:\n
|
262
|
-
(('note:新メンテナー曰く'))
|
263
|
-
* Can't maintain Test::Unit because it's too complex\n
|
264
|
-
(('note:Test::Unitは複雑すぎてメンテナンスできない'))
|
265
|
-
|
266
258
|
= Ruby 1.8 times: 2\n(('note:Ruby 1.8の時代:2'))
|
267
259
|
|
268
260
|
RSpec was born\n
|
@@ -314,6 +306,29 @@ Engl-ish\n
|
|
314
306
|
* Mock, Not implemented, ...\n
|
315
307
|
(('note:モックや未実装など'))
|
316
308
|
|
309
|
+
= Test::Unit in Ruby 1.8\n(('note:Ruby 1.8バンドル後のTest::Unit'))
|
310
|
+
|
311
|
+
* No active development\n
|
312
|
+
(('note:開発は停滞'))
|
313
|
+
* Maintainer was changed\n
|
314
|
+
(('note:メンテナー交代'))
|
315
|
+
* The author of minitest\n
|
316
|
+
(('note:後のminitestの作者'))
|
317
|
+
|
318
|
+
= RSpec and Test::Unit
|
319
|
+
|
320
|
+
* RSpec is getting better but Test::Unit isn't changed...\n
|
321
|
+
(('note:RSpecはよくなっているのにTest::Unitは変わらない。。。'))
|
322
|
+
* Test::Unit should also be getting better!\n
|
323
|
+
(('note:Test::Unitももっとよくしたい!'))
|
324
|
+
|
325
|
+
= Test::Unit:\nnew maintainer\n(('note:新しいメンテナー'))
|
326
|
+
|
327
|
+
* New maintainer said:\n
|
328
|
+
(('note:新メンテナー曰く'))
|
329
|
+
* Can't maintain Test::Unit because it's too complex\n
|
330
|
+
(('note:Test::Unitは複雑すぎてメンテナンスできない'))
|
331
|
+
|
317
332
|
= Wrap up: Ruby 1.8 times\n(('note:Ruby 1.8時代のまとめ'))
|
318
333
|
|
319
334
|
* Ruby starts bundling Test::Unit (('note:((({/\\Atest.+unit\\z/i})))'))\n
|
@@ -338,7 +353,7 @@ Engl-ish\n
|
|
338
353
|
* Still (({/\Atest.+unit\z/i}))\n
|
339
354
|
(('note:名前変更後も(({/\Atest.+unit\z/i}))'))
|
340
355
|
* (('note:test-unit 1.2.3 == Test::Unit in Ruby 1.8'))
|
341
|
-
* Maintainer
|
356
|
+
* Maintainer was changed\n
|
342
357
|
(('note:メンテナー交代'))
|
343
358
|
* Me\n
|
344
359
|
(('note:私'))
|
@@ -350,8 +365,8 @@ Engl-ish\n
|
|
350
365
|
(('note:開発は活発'))
|
351
366
|
* High backward compatibility\n
|
352
367
|
(('note:高い後方互換性'))
|
353
|
-
* Exception: Inheritance
|
354
|
-
(('note
|
368
|
+
* Exception: Inheritance\n
|
369
|
+
(('note:例外:継承時の挙動'))
|
355
370
|
|
356
371
|
= minitest
|
357
372
|
|
@@ -369,28 +384,30 @@ Engl-ish\n
|
|
369
384
|
(('note:作者曰く'))
|
370
385
|
* 100% Test::Unit compatible\n
|
371
386
|
(('note:Test::Unitと100%互換'))
|
387
|
+
* But it's not compat in fact...\n
|
388
|
+
(('note:実際は互換ではなかった。。。'))
|
372
389
|
|
373
390
|
= test/unit in Ruby 1.9
|
374
391
|
|
375
|
-
* Not Test::Unit (('note:but (({/\\Atest.+unit\\z/i}))'))\n
|
376
|
-
(('note:Test::Unitではないが(({/\\Atest.+unit\\z/i}))ではある'))
|
377
392
|
* Provide Test::Unit API\n
|
378
393
|
(('note:Test::Unit互換APIを提供'))
|
379
394
|
* Wrapper of minitest\n
|
380
395
|
(('note:minitestのラッパー'))
|
381
|
-
* Ruby developers
|
396
|
+
* Ruby developers developed it\n
|
382
397
|
not minitest author\n
|
383
398
|
(('note:minitestの作者ではなくRuby開発者が開発'))
|
399
|
+
* Not Test::Unit (('note:but (({/\\Atest.+unit\\z/i}))'))\n
|
400
|
+
(('note:Test::Unitではないが(({/\\Atest.+unit\\z/i}))ではある'))
|
384
401
|
|
385
402
|
= Wrap up: Ruby 1.9 times\n(('note:Ruby 1.9時代のまとめ'))
|
386
403
|
|
387
|
-
* Ruby
|
404
|
+
* Ruby dropped Test::Unit\n
|
388
405
|
(('note:RubyがTest::Unitを捨てた'))
|
389
406
|
* (('note:Test::Unit → test-unit gem'))
|
390
|
-
* Ruby
|
407
|
+
* Ruby bundled minitest\n
|
391
408
|
(('note:Rubyはminitestをバンドルした'))
|
392
|
-
* Ruby
|
393
|
-
(('note:(test/unit
|
409
|
+
* Ruby created test/unit\n
|
410
|
+
(('note:(test/unit provided Test::Unit API)'))\n
|
394
411
|
(('note:RubyはTest::Unit APIを提供する(({test/unit}))を新しく作った'))
|
395
412
|
|
396
413
|
= Ruby 2.0 times\n(('note:Ruby 2.0の時代'))
|
@@ -418,8 +435,8 @@ Engl-ish\n
|
|
418
435
|
|
419
436
|
= Is no test/unit problem?\n(('note:test/unitがないことは問題なのか?'))
|
420
437
|
|
421
|
-
* Ruby
|
422
|
-
(('note:RubyはRubyのテストにtest/unit
|
438
|
+
* Ruby used test/unit for Ruby's test\n
|
439
|
+
(('note:RubyはRubyのテストにtest/unitを使っていた'))
|
423
440
|
* No test/unit means existing tests can't be worked\n
|
424
441
|
(('note:test/unitがなくなると既存のテストが動かない'))
|
425
442
|
|
@@ -445,7 +462,7 @@ Accepted!
|
|
445
462
|
|
446
463
|
* Need to care existing Test::Unit API users\n
|
447
464
|
(('note:既存のTest::Unit APIユーザーをケアする必要がある'))
|
448
|
-
* Backward compat
|
465
|
+
* Backward compat is important!\n
|
449
466
|
(('note:後方互換性は重要!'))
|
450
467
|
* Bundle test-unit gem too for Test::Unit API\n
|
451
468
|
(('note:Test::Unit互換APIのためにtest-unit gemもバンドル'))
|
@@ -458,12 +475,12 @@ Accepted!
|
|
458
475
|
= Ruby 2.2 times: 1\n(('note:Ruby 2.2の時代:1'))
|
459
476
|
|
460
477
|
* 2014-
|
461
|
-
*
|
478
|
+
* Upgrade bundled minitest to 5\n
|
462
479
|
(('note:バンドルしているminitestを5に更新'))
|
463
480
|
* Move minitest 4 and test/unit to test/\n
|
464
481
|
(('note:minitest 4とtest/unitはtest/以下に移動'))
|
465
482
|
|
466
|
-
=
|
483
|
+
= Upgrade minitest to 5\n(('note:minitest 5に更新'))
|
467
484
|
|
468
485
|
# coderay diff
|
469
486
|
- lib/minitest/*.rb
|
@@ -488,9 +505,397 @@ test-unit gem provides:
|
|
488
505
|
lib/test/unit.rb
|
489
506
|
lib/test/unit/**/*.rb
|
490
507
|
|
491
|
-
= test/unit in Ruby 2.2
|
508
|
+
= test/unit in Ruby 2.2\n(('note:Ruby 2.2のtest/unit'))
|
509
|
+
|
510
|
+
* For Ruby developers\n
|
511
|
+
(('note:Ruby開発者にとっては'))
|
512
|
+
* test/lib/test/unit
|
513
|
+
* For users\n
|
514
|
+
(('note:ユーザーにとっては'))
|
515
|
+
* lib/test/unit = test-unit gem
|
516
|
+
|
517
|
+
= Wrap up: Ruby 2.2 times\n(('note:Ruby 2.2時代のまとめ'))
|
492
518
|
|
493
|
-
*
|
494
|
-
|
519
|
+
* Bundle minitest 5\n
|
520
|
+
(('note:minitest 5をバンドル'))
|
521
|
+
* Bundle test-unit again\n
|
522
|
+
(('note:再びtest-unitをバンドル'))
|
523
|
+
* Ruby's tests use forked mintiest 4 and test/unit\n
|
524
|
+
(('note:Rubyのテストはフォークしたminitest 4とtest/unitを使う'))
|
495
525
|
|
496
|
-
=
|
526
|
+
= Ruby 2.3 times\n(('note:Ruby 2.3の時代'))
|
527
|
+
|
528
|
+
* 2015-
|
529
|
+
* No highly important things\n
|
530
|
+
(('note:特筆すべきことはない'))
|
531
|
+
|
532
|
+
= Wrap up: History: 1\n(('note:歴史のまとめ:1'))
|
533
|
+
|
534
|
+
* Ruby 1.4 and 1.6 didn't bundle any testing framework\n
|
535
|
+
(('note:Ruby 1.4と1.6はテスティングフレームワークをバンドル'))\n
|
536
|
+
(('note:していなかった'))
|
537
|
+
* Test::Unit was born in Ruby 1.6 times\n
|
538
|
+
(('note:Ruby 1.6の時代にTest::Unitが生まれた'))
|
539
|
+
* The first (({/\Atest.+unit\z/i}))
|
540
|
+
|
541
|
+
= Wrap up: History: 2\n(('note:歴史のまとめ:2'))
|
542
|
+
|
543
|
+
* Ruby 1.8 bundled Test::Unit\n
|
544
|
+
(('note:Ruby 1.8はTest::Unitをバンドルした'))
|
545
|
+
* (({/\Atest.+unit\z/i})) in 1.8
|
546
|
+
* Ruby 1.9 dropped Test::Unit and bundled minitest\n
|
547
|
+
(('note:Ruby 1.9はTest::Unitを捨ててminitestをバンドルした'))
|
548
|
+
|
549
|
+
= Wrap up: History: 3\n(('note:歴史のまとめ:3'))
|
550
|
+
|
551
|
+
* Ruby 1.9 provided test/unit as a wrapper of minitest\n
|
552
|
+
(('note:Ruby 1.9はminitestのラッパーとしてtest/unitを提供した'))
|
553
|
+
* test/unit provided Test::Unit compatible API\n
|
554
|
+
(('note:test/unitはTest::Unitの互換APIを提供した'))
|
555
|
+
* (({/\Atest.+unit\z/i})) in 1.9
|
556
|
+
|
557
|
+
= Wrap up: History: 4\n(('note:歴史のまとめ:4'))
|
558
|
+
|
559
|
+
* Ruby 2.0 is same as Ruby 1.9\n
|
560
|
+
(('note:Ruby 2.0の状況はRuby 1.9と変わらない'))
|
561
|
+
* test/unit is (({/\Atest.+unit\z/i})) in 2.0\n
|
562
|
+
(('note:つまり、2.0での(({/\Atest.+unit\z/i}))はtest/unit'))
|
563
|
+
|
564
|
+
= Wrap up: History: 5\n(('note:歴史のまとめ:5'))
|
565
|
+
|
566
|
+
* Ruby 2.1 didn't upgrade minitest to 5\n
|
567
|
+
(('note:Ruby 2.1はminitestを5に更新しなかった'))
|
568
|
+
* minitest 5 has backward incompatible changes\n
|
569
|
+
(('note:minitest 5には後方非互換の変更があった'))
|
570
|
+
* It breaks Ruby's tests\n
|
571
|
+
(('note:非互換を受け入れるとRubyのテストが動かなくなる'))
|
572
|
+
|
573
|
+
= Wrap up: History: 6\n(('note:歴史のまとめ:6'))
|
574
|
+
|
575
|
+
* Ruby 2.2 upgraded minitest\n
|
576
|
+
(('note:Ruby 2.2はminitestを5に更新した'))
|
577
|
+
* Dropped test/unit as minitest wrapper\n
|
578
|
+
(('note:Ruby 2.2はminitestのラッパーのtest/unitを捨てた'))
|
579
|
+
* Used forked minitest 4 and test/unit for its tests\n
|
580
|
+
(('note:Ruby 2.2はRubyのテスト用にminitest 4のフォークとtest/unitを使うことにした'))
|
581
|
+
|
582
|
+
= Wrap up: History: 7\n(('note:歴史のまとめ:7'))
|
583
|
+
|
584
|
+
* Ruby 2.2 bundled test-unit gem again\n
|
585
|
+
(('note:Ruby 2.2はtest-unit gemを再びバンドルした'))
|
586
|
+
* (({/\Atest.+unit\z/i})) in 2.2
|
587
|
+
|
588
|
+
= Wrap up: History: 8\n(('note:歴史のまとめ:8'))
|
589
|
+
|
590
|
+
* No highly important things in Ruby 2.3\n
|
591
|
+
(('note:Ruby 2.3には特筆すべきことはない'))
|
592
|
+
|
593
|
+
= What's (({/\Atest.+unit\z/i}))\n(('note:(({/\\Atest.+unit\\z/i}))はなにか'))
|
594
|
+
|
595
|
+
Test::Unit compatible API\n
|
596
|
+
(('note:Test::Unit互換API'))
|
597
|
+
|
598
|
+
= Test::Unit compat API\n(('note:Test::Unit互換API'))
|
599
|
+
|
600
|
+
# coderay ruby
|
601
|
+
class XXXTest < Test::Unit::TestCase
|
602
|
+
def test_xxx
|
603
|
+
assert_equal(xxx, yyy)
|
604
|
+
end
|
605
|
+
end
|
606
|
+
|
607
|
+
= Test::Unit API spirit\n(('note:Test::Unit APIの魂'))
|
608
|
+
|
609
|
+
Ruby-ish\n
|
610
|
+
(('note:Rubyらしさ'))
|
611
|
+
|
612
|
+
= Ruby-ish in Test::Unit\n(('note:Test::UnitでのRubyらしさ'))
|
613
|
+
|
614
|
+
* Write test as normal Ruby script\n
|
615
|
+
(('note:普通のRubyスクリプトのようにテストを書ける'))
|
616
|
+
* It's also important in minitest\n
|
617
|
+
(('note:minitestもこれを大事にしている'))
|
618
|
+
|
619
|
+
= By example: 1\n(('note:実例:1'))
|
620
|
+
|
621
|
+
(('tag:center'))
|
622
|
+
(('tag:x-large'))
|
623
|
+
Grouping tests\n
|
624
|
+
(('note:テストのグループ化'))
|
625
|
+
|
626
|
+
(('wait'))
|
627
|
+
(('tag:center'))
|
628
|
+
(('tag:x-large'))
|
629
|
+
↓\n
|
630
|
+
class
|
631
|
+
|
632
|
+
= Group: 1\n(('note:グループ化:1'))
|
633
|
+
|
634
|
+
# coderay ruby
|
635
|
+
class TestAdd < Test::Unit::TestCase
|
636
|
+
def test_positive_positive
|
637
|
+
assert_equal(3, 1 + 2)
|
638
|
+
end
|
639
|
+
|
640
|
+
def test_positive_negative
|
641
|
+
assert_equal(-2, 1 + -3)
|
642
|
+
end
|
643
|
+
end
|
644
|
+
|
645
|
+
= Group: 2\n(('note:グループ化:2'))
|
646
|
+
|
647
|
+
# coderay ruby
|
648
|
+
class TestSub < Test::Unit::TestCase
|
649
|
+
def test_positive_positive
|
650
|
+
assert_equal(-2, 1 - 3)
|
651
|
+
end
|
652
|
+
|
653
|
+
def test_positive_negative
|
654
|
+
assert_equal(4, 1 - -3)
|
655
|
+
end
|
656
|
+
end
|
657
|
+
|
658
|
+
= Group: 3\n(('note:グループ化:3'))
|
659
|
+
|
660
|
+
# coderay ruby
|
661
|
+
class TestCalc < Test::Unit::TestCase
|
662
|
+
class TestAdd < self # TestAdd < TestCalc
|
663
|
+
# def test_positive_positive
|
664
|
+
# def test_positive_negative
|
665
|
+
end
|
666
|
+
class TestSub < self # TestAdd < TestCalc
|
667
|
+
# def test_positive_positive
|
668
|
+
# def test_positive_negative
|
669
|
+
end
|
670
|
+
end
|
671
|
+
|
672
|
+
= Wrap up: Group: 1\n(('note:グループ化のまとめ:1'))
|
673
|
+
|
674
|
+
* Test case has tests\n
|
675
|
+
(('note:テストケースは複数のテストを持つ'))
|
676
|
+
* Test case is class\n
|
677
|
+
(('note:テストケースをクラスとして実装'))
|
678
|
+
* Test is method\n
|
679
|
+
(('note:テストをメソッドとして実装'))
|
680
|
+
* Class has methods\n
|
681
|
+
(('note:クラスは複数のメソッドを持つ'))
|
682
|
+
|
683
|
+
= Wrap up: Group: 2\n(('note:グループ化のまとめ:2'))
|
684
|
+
|
685
|
+
* Sub test case is sub class\n
|
686
|
+
(('note:サブテストケースはサブクラスとして実装'))
|
687
|
+
* Sub test case is-a parent test case\n
|
688
|
+
(('note:TestAdd is a test case of TestCalc'))\n
|
689
|
+
(('note:サブテストケースは親テストケースとis-aの関係'))
|
690
|
+
|
691
|
+
= FYI: Group\n(('note:参考情報:グループ化'))
|
692
|
+
|
693
|
+
* Test::Unit and minitest don't support sub test case is a sub class\n
|
694
|
+
(('note:Test::Unitとminitestはサブクラスでサブテストケースを作ることをサポートしていない'))
|
695
|
+
* test-unit only supports it\n
|
696
|
+
(('note:test-unitだけがサポートしている'))
|
697
|
+
* It's only one incompatibles\n
|
698
|
+
(('note:唯一の非互換'))
|
699
|
+
|
700
|
+
= By example: 2\n(('note:実例:2'))
|
701
|
+
|
702
|
+
(('tag:center'))
|
703
|
+
(('tag:x-large'))
|
704
|
+
Share tests\n
|
705
|
+
(('note:テストの共有'))
|
706
|
+
|
707
|
+
(('wait'))
|
708
|
+
(('tag:center'))
|
709
|
+
(('tag:x-large'))
|
710
|
+
↓\n
|
711
|
+
module
|
712
|
+
|
713
|
+
= Share: 1\n(('note:共有:1'))
|
714
|
+
|
715
|
+
# coderay ruby
|
716
|
+
module KVSTests
|
717
|
+
def test_read_write
|
718
|
+
@kvs[:key] = :value
|
719
|
+
assert_equal(:value, @kvs[:key])
|
720
|
+
end
|
721
|
+
end
|
722
|
+
|
723
|
+
= Share: 2\n(('note:共有:2'))
|
724
|
+
|
725
|
+
# coderay ruby
|
726
|
+
class TestKVSHash < Test::Unit::TestCase
|
727
|
+
include KVSTests
|
728
|
+
def setup; @kvs = {}; end
|
729
|
+
end
|
730
|
+
class TestKVSOpenStruct < Test::Unit::TestCase
|
731
|
+
include KVSTests
|
732
|
+
def setup; @kvs = OpenStruct.new; end
|
733
|
+
end
|
734
|
+
end
|
735
|
+
|
736
|
+
= Wrap up: Share\n(('note:共有のまとめ'))
|
737
|
+
|
738
|
+
* Tests can be shared by module\n
|
739
|
+
(('note:モジュールでテストを共有できる'))
|
740
|
+
* Module is used for sharing method implementations in Ruby\n
|
741
|
+
(('note:Rubyではモジュールはメソッドの実装を共有するために使われている'))
|
742
|
+
|
743
|
+
= By example: 3\n(('note:実例:3'))
|
744
|
+
|
745
|
+
(('tag:center'))
|
746
|
+
(('tag:x-large'))
|
747
|
+
Assertion\n
|
748
|
+
(('note:アサーション'))
|
749
|
+
|
750
|
+
(('wait'))
|
751
|
+
(('tag:center'))
|
752
|
+
(('tag:x-large'))
|
753
|
+
↓\n
|
754
|
+
Write as-is\n
|
755
|
+
(('note:そのまま書く'))
|
756
|
+
|
757
|
+
= Assert: Equal\n(('note:アサート:等価'))
|
758
|
+
|
759
|
+
# coderay ruby
|
760
|
+
def test_add
|
761
|
+
assert_equal(3,
|
762
|
+
1 + 2)
|
763
|
+
# ↑↓ as-is
|
764
|
+
# RSpec: expect(1 + 2).eq 3
|
765
|
+
end
|
766
|
+
|
767
|
+
= Assert: Predicate\n(('note:アサート:述語'))
|
768
|
+
|
769
|
+
# coderay ruby
|
770
|
+
def test_exist_readme
|
771
|
+
assert(File.exist?("README"))
|
772
|
+
# ↑ as-is ↓ not as-is
|
773
|
+
# RSpec: expect(File).to exist("README")
|
774
|
+
end
|
775
|
+
|
776
|
+
= Message from minitest
|
777
|
+
|
778
|
+
# _
|
779
|
+
1) Failure:
|
780
|
+
TestFile#test_exist_readme [test-file-minitest.rb:5]:
|
781
|
+
Failed assertion, no message given.
|
782
|
+
|
783
|
+
(('tag:center'))
|
784
|
+
Less information
|
785
|
+
|
786
|
+
= Message from RSpec
|
787
|
+
|
788
|
+
# pango
|
789
|
+
1) File README should exist
|
790
|
+
<span foreground="red">Failure/Error: expect(File).to exist("README")</span>
|
791
|
+
<span foreground="red">expected File to exist</span>
|
792
|
+
<span foreground="cyan"># ./spec-file.rb:5:in `block (2 levels) in <top (required)>'</span>
|
793
|
+
|
794
|
+
(('tag:center'))
|
795
|
+
Colorized and snippet
|
796
|
+
|
797
|
+
= Message from test-unit
|
798
|
+
|
799
|
+
# pango
|
800
|
+
<span foreground="white" background="red">Failure</span>: <false> is not true.
|
801
|
+
test_exist_readme(TestFile)
|
802
|
+
test-file-test-unit.rb:5:in `test_exist_readme'
|
803
|
+
2:
|
804
|
+
3: class TestFile < Test::Unit::TestCase
|
805
|
+
4: def test_exist_readme
|
806
|
+
<span foreground="white" background="red"> => 5: assert(File.exist?("README"))</span>
|
807
|
+
6: end
|
808
|
+
7: end
|
809
|
+
|
810
|
+
(('tag:center'))
|
811
|
+
Colorized and snippet
|
812
|
+
|
813
|
+
= power-assert
|
814
|
+
|
815
|
+
# coderay ruby
|
816
|
+
def test_exist_readme
|
817
|
+
assert do
|
818
|
+
File.exist?("README")
|
819
|
+
# ↑ as-is
|
820
|
+
end
|
821
|
+
end
|
822
|
+
|
823
|
+
(('tag:center'))
|
824
|
+
(('note:Built-in in test-unit'))
|
825
|
+
|
826
|
+
= Message: power-assert
|
827
|
+
|
828
|
+
# pango
|
829
|
+
<span foreground="white" background="red">Failure</span>:
|
830
|
+
File.exist?("README")
|
831
|
+
| |
|
832
|
+
| false
|
833
|
+
File (NOTE: ← Receiver information)
|
834
|
+
test_exist_readme(TestFile)
|
835
|
+
/usr/lib/ruby/vendor_ruby/power_assert.rb:36:in `start'
|
836
|
+
test-file-power-assert.rb:5:in `test_exist_readme'
|
837
|
+
2:
|
838
|
+
3: class TestFile < Test::Unit::TestCase
|
839
|
+
4: def test_exist_readme
|
840
|
+
<span foreground="white" background="red"> => 5: assert do</span>
|
841
|
+
6: File.exist?("README")
|
842
|
+
7: end
|
843
|
+
8: end
|
844
|
+
|
845
|
+
= FYI: test-unit and power-assert
|
846
|
+
|
847
|
+
* Don't recommend\n
|
848
|
+
"all power-assert"\n
|
849
|
+
(('note:すべてpower-assertは非推奨'))
|
850
|
+
* Recommend "power-assert only for predicate"\n
|
851
|
+
(('note:述語だけpower-assertを推奨'))
|
852
|
+
|
853
|
+
= Assert: Equal
|
854
|
+
|
855
|
+
# coderay ruby
|
856
|
+
# @group.users should return
|
857
|
+
# sorted names of user
|
858
|
+
assert_equal(user_names.sort,
|
859
|
+
@group.users)
|
860
|
+
# ↑ Align-able
|
861
|
+
assert do
|
862
|
+
@group.users == user_names.sort
|
863
|
+
end
|
864
|
+
|
865
|
+
= Align\n(('note:縦に並べる'))
|
866
|
+
|
867
|
+
* Indicate compare targets visually\n
|
868
|
+
(('note:視覚的に比較対象ということを示す'))
|
869
|
+
* Clarify differences visually\n
|
870
|
+
(('note:視覚的に違いを明確にする'))
|
871
|
+
|
872
|
+
= e.g.: diff\n(('note:例:diff'))
|
873
|
+
|
874
|
+
Hello Heilo
|
875
|
+
-----------
|
876
|
+
Hello
|
877
|
+
Heilo
|
878
|
+
|
879
|
+
= Align in Ruby\n(('note:Rubyで縦に並べる'))
|
880
|
+
|
881
|
+
# coderay ruby
|
882
|
+
# Arguments are natural
|
883
|
+
method(arg1,
|
884
|
+
arg2)
|
885
|
+
# Operands aren't natural
|
886
|
+
operand1 ==
|
887
|
+
operand2
|
888
|
+
|
889
|
+
(('tag:center'))
|
890
|
+
(('note:引数だと自然だけどオペランドだと不自然'))
|
891
|
+
|
892
|
+
= Wrap up: Test::Unit API\n(('note:まとめ:Test::Unit API'))
|
893
|
+
|
894
|
+
* Ruby-ish is important in Test::Unit API\n
|
895
|
+
(('note:Test::Unit APIではRubyらしいことは重要'))
|
896
|
+
* (Sub) test case and (sub) class\n
|
897
|
+
(('note:(サブ)テストケースと(サブ)クラス'))
|
898
|
+
* Share tests and module\n
|
899
|
+
(('note:テストの共有とモジュール'))
|
900
|
+
* as-is in assert\n
|
901
|
+
(('note:アサートではそのままの使い方で書く'))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit-slide-kou-rubykaigi-2015
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2015.12.12.
|
4
|
+
version: 2015.12.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rabbit
|