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.1k
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
2k
Expoで開発してアプリを公開して得られた知見 / RNM6
pchw
3
1.8k
Firebaseでラクラクリアルタイムアプリ
pchw
0
1.3k
MongoDB族のための組み込み軽量DB NeDB
pchw
0
1.4k
月刊ライトニングトーク2014年8月号: MEAN 祭り資料
pchw
0
4.3k
Synth - 東京Node学園2014
pchw
0
4.3k
Other Decks in Programming
See All in Programming
『品質』という言葉が嫌いな理由
korimu
0
160
Spring gRPC について / About Spring gRPC
mackey0225
0
220
GoとPHPのインターフェイスの違い
shimabox
2
190
定理証明プラットフォーム lapisla.net
abap34
1
1.8k
Java Webフレームワークの現状 / java web framework at burikaigi
kishida
9
2.2k
Writing documentation can be fun with plugin system
okuramasafumi
0
120
技術を根付かせる / How to make technology take root
kubode
1
250
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
120
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
220
Formの複雑さに立ち向かう
bmthd
1
850
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
300
ソフトウェアエンジニアの成長
masuda220
PRO
10
1.2k
Featured
See All Featured
Music & Morning Musume
bryan
46
6.3k
Six Lessons from altMBA
skipperchong
27
3.6k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
GitHub's CSS Performance
jonrohan
1030
460k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Git: the NoSQL Database
bkeepers
PRO
427
64k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
The Cult of Friendly URLs
andyhume
78
6.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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ਫ༵