Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Quickはいいぞ

 Quickはいいぞ

2016/03/01(火) shibuya.swift

テストフレームワークのQuickについて。

9d1961575e45a8286cdde5f86dbba312?s=128

akatsuki174

March 01, 2016
Tweet

Transcript

  1. Quick͸͍͍ͧ @akatsuki174

  2. ࣗݾ঺հ • ๭ιϑτ΢ΣΞձࣾΤϯδχΞ(2೥໨) άϩʔεϋοΧʔ → WebΤϯδχΞ → iOSΤϯδχΞ • Twitter,

    Qiita, SlideShare, Github →akatsuki174
  3. ࠓճͷࢿྉ ͜ͷεϥΠυ https://speakerdeck.com/akatsuki174/ quickhaiizo Qiitaͷهࣄ(εϥΠυલ൒) http://qiita.com/akatsuki174/items/ 0ed315456d267cde19f4 αϯϓϧίʔυ https://github.com/akatsuki174/ QuickSample

  4. ໨࣍ Quickͷ֓ཁ XCTestͱQuickΛൺ΂ͯΈΑ͏ NimbleͰͰ͖Δ͜ͱΛֶ΅͏ ·ͱΊɿQuickͷΠΠτίϩ

  5. ໨࣍ Quickͷ֓ཁ XCTestͱQuickΛൺ΂ͯΈΑ͏ NimbleͰͰ͖Δ͜ͱΛֶ΅͏ ·ͱΊɿQuickͷΠΠτίϩ

  6. Quickͱ͸ “Quick is a behavior-driven development framework for Swift and

    Objective-C. Inspired by RSpec, Specta, and Ginkgo.” https://github.com/Quick/QuickΑΓൈਮ →Swift, Objective-CͷͨΊͷBDDςετϑ ϨʔϜϫʔΫ
  7. ೔ຊޠυΩϡϝϯτొ৔

  8. ͦͷ࣌ਓ͸

  9. Nimbleͱ͸ Quick͕಺෦Ͱ࢖͍ͬͯΔmatcherɻ XCTestΛ࢖͏ΑΓ΋ظ଴஋ͱ࣮ࡍͷ ஋ΛΑΓ໌֬ʹද͢͜ͱ͕Ͱ͖Δɻ

  10. ໨࣍ Quickͷ֓ཁ XCTestͱQuickΛൺ΂ͯΈΑ͏ NimbleͰͰ͖Δ͜ͱΛֶ΅͏ ·ͱΊɿQuickͷΠΠτίϩ

  11. XCTestͱQuickΛൺ΂ͯΈΑ͏ ςετϝιουͷॻ͖ํ ςετͷॻ͖ํ ςετ͕ࣦഊͨ࣌͠ͷදࣔ

  12. XCTestͱQuickΛൺ΂ͯΈΑ͏ ςετϝιουͷॻ͖ํ ςετͷॻ͖ํ ςετ͕ࣦഊͨ࣌͠ͷදࣔ

  13. ςετϝιουͷॻ͖ํ XCTest Quick

  14. ςετϝιουͷॻ͖ํ XCTest Quick

  15. ςετϝιουͷॻ͖ํ XCTest Quick describe describe context it

  16. XCTestͱQuickΛൺ΂ͯΈΑ͏ ςετϝιουͷॻ͖ํ ςετͷॻ͖ํ ςετ͕ࣦഊͨ࣌͠ͷදࣔ

  17. ςετͷॻ͖ํ XCTest Quick

  18. XCTestͱQuickΛൺ΂ͯΈΑ͏ ςετϝιουͷॻ͖ํ ςετͷॻ͖ํ ςετ͕ࣦഊͨ࣌͠ͷදࣔ

  19. ςετ͕ࣦഊͨ࣌͠ͷදࣔ XCTest Quick

  20. ໨࣍ Quickͷ֓ཁ XCTestͱQuickΛൺ΂ͯΈΑ͏ NimbleͰͰ͖Δ͜ͱΛֶ΅͏ ·ͱΊɿQuickͷΠΠτίϩ

  21. toEventually(, toEventuallyNot) ඇಉظͷςετ ެࣜΑΓɻ

  22. matcherؔ਺ ެࣜΑΓɻ

  23. matcherؔ਺ ެࣜΑΓɻ Swift Error Handling

  24. matcherؔ਺ ެࣜΑΓɻ Collection Membership

  25. matcherؔ਺ ެࣜΑΓɻ Strings

  26. matcherؔ਺ ެࣜΑΓɻ Checking if all elements of a collection pass

    a condition
  27. matcherؔ਺ ެࣜΑΓɻ Matching a value to any of a group

    of matchers
  28. ໨࣍ Quickͷ֓ཁ XCTestͱQuickΛൺ΂ͯΈΑ͏ NimbleͰͰ͖Δ͜ͱΛֶ΅͏ ·ͱΊɿQuickͷΠΠτίϩ

  29. ·ͱΊɿQuickͷΠΠτίϩ 1. ΤϥʔϝοηʔδΛΘ͟Θ͟ ɹॻ͔ͳ͍͍ͯ͘ 2. NimbleͰॊೈͳAssert͕ॻ͚Δ 3. ςετͷ·ͱ·Γ͕Θ͔Γ΍͍͢

  30. ·ͱΊɿQuickͷΠΠτίϩ 1. ΤϥʔϝοηʔδΛΘ͟Θ͟ ɹॻ͔ͳ͍͍ͯ͘ 2. NimbleͰॊೈͳAssert͕ॻ͚Δ 3. ςετͷ·ͱ·Γ͕Θ͔Γ΍͍͢

  31. ςετͷ·ͱ·Γ͕ Θ͔Γ΍͍͢ XCTest Quick

  32. Έͳ͞Μ΋ QuickΛ࢖ͬͯΈ·͠ΐ͏

  33. ऴΘΓ