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

Swiftのテストフレームワーク Quickを使ってみよう!

Swiftのテストフレームワーク Quickを使ってみよう!

Swiftビギナーズ勉強会 2015/06/20 @コワーキングスペース茅場町 Co-Edo

7d709dd44f86dc8f2b7ddb4c48145dfc?s=128

jollyjoester

June 20, 2015
Tweet

More Decks by jollyjoester

Other Decks in Technology

Transcript

  1. SwiftͷςετϑϨʔϜϫʔΫ QuickΛ࢖ͬͯΈΑ͏ʂ SwiftϏΪφʔζษڧձ 2015/06/20

  2. • ࣣౡҒ೭ʢͳͳ͠·ͻͰΏ͖ʣ • Repro.Inc / ໺ྑΤϯδχΞ • iPhone / Android

    • Java -> Objective-C -> Swift
  3. https://repro.io/

  4. Repro

  5. ຊॻ͖·ͨ͠ʂ • 2015/04/10ɹٕज़ධ࿦͔ࣾΒൃച ࢒೦ͳ͕ΒSwift1.1࣌୅ Ͱ΋ਖ਼ޡදͱαϯϓϧϓϩάϥϜ͸Swift1.2ରԠ

  6. Quick is a behavior-driven development framework for Swift and Objective-C

    Inspired by RSpec, Specta, and Ginkgo.
  7. behavior-driven development BBD? ϓϩάϥϜͷಈ࡞͕ਖ਼͍͔͠Ͳ͏͔Λݕূ͢ΔͨΊʹߦ͏ʮςετʯ + ظ଴͞ΕΔʮৼΔ෣͍ʯ΍ʮ੍໿৚݅ʯΛࣗવݴޠͰซه from wikipedia

  8. Example https://github.com/Quick/QuickͷυΩϡϝϯτΑΓ

  9. ͬͦ͘͞ಋೖͯ͠ΈΑ͏ • Xcode6.3 & Swift1.2 • ಋೖํ๏ • Git Submodules

    • CocoaPods ← ࠓճ͸͍ͭ͜Ͱ(※Version 0.36.0 Ҏ্͕ඞཁ) • Carthage
  10. New project ͋Γ͕ͪͳQuickSampleͱ͓ͯ͘͠

  11. pod install Podfile target : ςετϓϩδΣΫτͷTarget use_frameworks! : SwiftΛ࢖͏ͷʹඞཁ pod

    ‘Quick’, ‘0.3.0’ : Swift1.2Ͱ࢖͑Δόʔδϣϯ pod ‘Nimble’ : QuickͰ࢖͏Matcher
  12. Build Settings Build Settings -> Defines ModuleΛYESʹ

  13. ͋Γ͕ͪͳܭࢉΫϥεΛ࡞ͬͯΈΔ ςετ͢Δclass, method͸publicʹ

  14. ςετΫϥε࡞੒ Alcatraz͔ΒTemplate΋ΠϯετʔϧͰ͖ΔΑ

  15. import module • ͖ͬ͞Defines ModuleΛYESʹͨ͠ͷͰ ·ΔͬͱςετTarget͔ΒࢀরͰ͖ΔΑ͏ʹͳΔ

  16. ॳΊͯͷςετίʔυ

  17. ςετ࣮ߦʂ Command + U ↓ ↓ ↓

  18. Have nice Devʂ