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.7k
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
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
Amazon Qを使ってIaCを触ろう!
maruto
0
420
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
CSC509 Lecture 11
javiergs
PRO
0
180
Functional Event Sourcing using Sekiban
tomohisa
0
100
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
940
Macとオーディオ再生 2024/11/02
yusukeito
0
380
Realtime API 入門
riofujimon
0
150
Click-free releases & the making of a CLI app
oheyadam
2
120
カンファレンスの「アレ」Webでなんとかしませんか? / Conference “thing” Why don't you do something about it on the Web?
dero1to
1
110
Featured
See All Featured
Building an army of robots
kneath
302
43k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
A designer walks into a library…
pauljervisheath
204
24k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Designing the Hi-DPI Web
ddemaree
280
34k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
4 Signs Your Business is Dying
shpigford
180
21k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
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ਫ༵