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
3k
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
1.8k
Expoで開発してアプリを公開して得られた知見 / RNM6
pchw
3
1.6k
Firebaseでラクラクリアルタイムアプリ
pchw
0
1.2k
MongoDB族のための組み込み軽量DB NeDB
pchw
0
1.3k
月刊ライトニングトーク2014年8月号: MEAN 祭り資料
pchw
0
4.3k
Synth - 東京Node学園2014
pchw
0
4.2k
Other Decks in Programming
See All in Programming
デザインシステムで Tailwind CSSとCSS in JSに分散投資をしたら良かった話
fsubal
14
2.9k
PHPでOfficeファイルを取り扱う! PHP Officeライブラリを プロダクトに組み込んだ話
hirobe1999
0
830
Why 1 + 1 = 2 in Swift?
1plus4
1
240
Cloud RunとCloud PubSubでサーバレスなデータ基盤2024 with Terraform / Cloud Run and PubSub with Terraform
shinyorke
7
1.9k
Docker ハンズオン / docker-hands-on
suzukihoge
51
16k
Go1.22からの疑似乱数生成器について/go-122-pseudo-random-generator
convto
1
160
Deep Dive 大規模システムアーキテクチャ/開発組織エンジニアリング / Deep Dive Large-Scale System Architecture, Development Organization Engineering
nrslib
15
2.9k
Enhancing Applications with Accessibility API
kishikawakatsumi
3
820
決断するための勇気、そのためのBacklog / Courage to make decisions, Backlog for that.
seike460
PRO
4
1.9k
DDD, necessary but insufficient: physical design principles for microservices
cer
PRO
0
2.1k
DDDはなぜ難しいのか / 良いコードの定義と設計能力の壁
pospome
24
6.7k
Some Quick Ideas To Improve Your Tests ( #jassttokyo )
teyamagu
PRO
2
2.3k
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
265
19k
Rebuilding a faster, lazier Slack
samanthasiow
72
8.2k
Teambox: Starting and Learning
jrom
126
8.4k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
101
6.6k
Automating Front-end Workflow
addyosmani
1353
200k
Visualization
eitanlees
135
14k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.8k
Keith and Marios Guide to Fast Websites
keithpitt
407
22k
Bash Introduction
62gerente
604
210k
Fontdeck: Realign not Redesign
paulrobertlloyd
75
4.8k
Writing Fast Ruby
sferik
619
59k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
28
5.9k
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ਫ༵