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.2k
Expoで開発してアプリを公開して得られた知見 / RNM6
pchw
3
1.9k
Firebaseでラクラクリアルタイムアプリ
pchw
0
1.4k
MongoDB族のための組み込み軽量DB NeDB
pchw
0
1.5k
月刊ライトニングトーク2014年8月号: MEAN 祭り資料
pchw
0
4.3k
Synth - 東京Node学園2014
pchw
0
4.4k
Other Decks in Programming
See All in Programming
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
960
AI活用のコスパを最大化する方法
ochtum
0
120
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.7k
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
590
ご飯食べながらエージェントが開発できる。そう、Agentic Engineeringならね。
yokomachi
1
290
Rails Girls Tokyo 18th GMO Pepabo Sponsor Talk
yutokyokutyo
0
200
atmaCup #23でAIコーディングを活用した話
ml_bear
4
750
Codex の「自走力」を高める
yorifuji
0
910
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
330
Python’s True Superpower
hynek
0
200
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
120
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
270
Featured
See All Featured
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
430
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
The untapped power of vector embeddings
frankvandijk
2
1.6k
エンジニアに許された特別な時間の終わり
watany
106
240k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
340
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
310
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
230
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
53k
The SEO Collaboration Effect
kristinabergwall1
0
380
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
110
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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ਫ༵