Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RubyMotion 1.15で追加されたtest周りの話
Search
pochi
July 24, 2012
Programming
1
3.2k
RubyMotion 1.15で追加されたtest周りの話
第一回RubyMotion 勉強会で話した資料
その他RubyMotion系の解説記事は
http://pchw.github.io/blog/categories/rubymotion/
へどうぞ
pochi
July 24, 2012
Tweet
Share
More Decks by pochi
See All by pochi
React Nativeで作ったアプリでRedux-Sagaを使ったので,その話 / TOM Internal Developer Session #7
pchw
0
2.1k
Expoで開発してアプリを公開して得られた知見 / RNM6
pchw
3
1.8k
Firebaseでラクラクリアルタイムアプリ
pchw
0
1.4k
MongoDB族のための組み込み軽量DB NeDB
pchw
0
1.4k
月刊ライトニングトーク2014年8月号: MEAN 祭り資料
pchw
0
4.3k
Synth - 東京Node学園2014
pchw
0
4.4k
Other Decks in Programming
See All in Programming
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
500
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.3k
奥深くて厄介な「改行」と仲良くなる20分
oguemon
1
520
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
680
ProxyによるWindow間RPC機構の構築
syumai
3
1.2k
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
6
2.4k
print("Hello, World")
eddie
2
530
モバイルアプリからWebへの横展開を加速した話_Claude_Code_実践術.pdf
kazuyasakamoto
0
320
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.4k
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
140
今から始めるClaude Code入門〜AIコーディングエージェントの歴史と導入〜
nokomoro3
0
110
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
How GitHub (no longer) Works
holman
315
140k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
Bash Introduction
62gerente
615
210k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
A Modern Web Designer's Workflow
chriscoyier
696
190k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.8k
How to Ace a Technical Interview
jacobian
279
23k
Rails Girls Zürich Keynote
gr2m
95
14k
Scaling GitHub
holman
463
140k
Transcript
RubyMotion 1.15ͰՃ͞ΕͨtestपΓͷ RubyMotion ษڧձ #1 @pchw 127݄25ਫ༵
intro Άͪ @pchw iPhoneΞϓϦͱ͔WebαʔϏεͱ͔ ࡞ͬͯ·͢ http://pchw.github.com/ 127݄25ਫ༵
ͬ͛͢ʔΞοϓσʔτ͕དྷΔͬͯ 127݄25ਫ༵
Viewͱ͔Controllerͱ͔ͷςετͰͨ͠ 127݄25ਫ༵
ͳʹ͕ग़དྷΔͷʁ ͜͜ʹSimulator͕ TestͰάϦάϦಈ͘ಈ ը͕షͬͯ͋ͬͨ 127݄25ਫ༵
127݄25ਫ༵
UIAutomationʹΑΔςετ Objective-CͰΞϓϦॻ͍ͯΔਓ ࣮લ͔Βग़དྷͯͨ 127݄25ਫ༵
127݄25ਫ༵
UIAutomationʹΑΔςετ͕Մೳʹ •ObjC •࣮લ͔Βग़དྷͯͨ •Ͱjavascript •RubyMotion •ΞϓϦ => Ruby •ςετ =>
Ruby 127݄25ਫ༵
ࣗಈԽग़དྷΔૢ࡞ view event tap flick pinch drag rotate device event
rotate acceleration shake 127݄25ਫ༵
४උ(app/app_delegate.rb) class AppDelegate def application(application, didFinishLaunchingWithOptions:launchOptions) return true if RUBYMOTION_ENV
== 'test' not for full application acceptance tests. Therefore you should not let the application launch as normal. 127݄25ਫ༵
ॻ͖ํ(spec/***.rb) describe “hoge” do tests <ControllerName> it “fugas” do controller.fuga.should
== ‘fuga’ end end 127݄25ਫ༵
viewͷࢦఆ describe ‘controlelr has label’ do tests Hoge it ‘has
label’ do view(‘hoge’).should.not == nil end end class Hoge < UIViewController def viewDidLoad label = UILabel.alloc.init label.accessibilityLabel = “hoge” end end 127݄25ਫ༵
Ͳ͏ͬͯݟ͚ͭͯΔͷ def _viewByName(accessibilityLabel) subviews.each do |subview| ʢུʣ 127݄25ਫ༵
ςετ࣮ߦ $ rake spec $ rake spec files=spec/hoge_spec.rb, spec/fuga_spec.rb 127݄25ਫ༵
rm-redgreen Before After 127݄25ਫ༵
reference Writing Test for RubyMotion Appsʢެࣜʣ http://www.rubymotion.com/developer-center/articles/testing/ Functional View and
Controller Testing with RubyMotionʢެࣜBlogʣ http://blog.rubymotion.com/post/26489000626/functional-view-and-controller-testing-with-rubymotion HipByte / RubyMotionʢtest/bacon-ui/specʹTest Sample͕͋Γ·͢ʣ https://github.com/HipByte/RubyMotion rm-redgreen https://github.com/mdks/rm-redgreen 127݄25ਫ༵