n e https :/ /github .com /M e n t o r s S c h o o l / t e s t i n g s - for - b e g i n n e r s $ c d t e s t i n g s - for - b e g i n n e r s $ b u n d l e i n s t a l l 2016/12/10 5
新規タスクを DB に保存 外部 API に新タスクを通知 etc . Use mocks for external dependencies like DB , Web API call , etc . Test targets include "bussiness logic ", etc . Unit testings はだいたい Small testings 2016/12/10 36
a l c u l a t o r = C a l c u l a t o r . n e w end def test _ 足し算ができる a s s e r t _ e q u a l ( @ c a l c u l a t o r . a d d ( 1, 3) , 4) end # snip . end JUnit (Java ), XCTest (XCode ), minitest (Ruby ), etc . 2016/12/10 44
a l c u l a t o r do d e s c r i b e "#add " do i t " 足し算ができる" do e x p e c t ( a d d ( 1, 3) ) . t o e q 4 end end # snip . end Spock (Groovy ), Quick (Swi ), RSpec (Ruby ), etc . ※ minitest は xUnit ・Spec いずれでも書ける 2016/12/10 45