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
m: a better Ruby Test::Unit runner
Search
Nick Quaranto
April 11, 2012
Programming
2
560
m: a better Ruby Test::Unit runner
Run tests by line number in Test::Unit, and more!
Presented at WNYRuby on April 11th, 2012.
Nick Quaranto
April 11, 2012
Tweet
Share
More Decks by Nick Quaranto
See All by Nick Quaranto
The GraphQL Way: A new path for JSON APIs
qrush
287
20k
Awesome Extractions Done Quick
qrush
1
540
rubygems.next
qrush
5
470
how to find GIFs
qrush
10
550
RubyMotion: The sleeper has awakened!
qrush
5
880
CoffeeScript - Spartan Javascript
qrush
0
560
Basecamp Next: Code Spelunking
qrush
62
9k
Test Driven Development
qrush
14
1.5k
Lapidary: The Art of Gemcutting
qrush
2
520
Other Decks in Programming
See All in Programming
PromptyによるAI開発入門
ymd65536
1
320
requirements with math
moony
0
460
研究開発と実装OSSと プロダクトの好循環 / A virtuous cycle of research and development implementation OSS and products
linyows
1
160
オレを救った Cline を紹介する
codehex
16
16k
読もう! Android build ドキュメント
andpad
1
180
Swift Testingのモチベを上げたい
stoticdev
2
260
CIBMTR振り返り+敗北から学ぶコンペの取り組み方反省
takanao
1
420
クックパッド検索システム統合/Cookpad Search System Consolidation
giga811
0
240
令和トラベルにおけるコンテンツ生成AIアプリケーション開発の実践
ippo012
1
210
DevNexus - Create AI Infused Java Apps with LangChain4j
kdubois
0
170
보일러플레이트 코드가 진짜 나쁜 건가요?
gaeun5744
0
330
SREチームのタスク優先度と向き合う Road to SRE NEXT@札幌
nealle
0
130
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
What's in a price? How to price your products and services
michaelherold
244
12k
How to Think Like a Performance Engineer
csswizardry
22
1.4k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.4k
We Have a Design System, Now What?
morganepeng
51
7.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
A Philosophy of Restraint
colly
203
16k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
590
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
Designing for Performance
lara
605
69k
GraphQLの誤解/rethinking-graphql
sonatard
69
10k
Transcript
m a better test-unit runner @qrush
i’m @qrush
@ i live here
c i work at 37signals
stands for metal m
None
runs tests by line number m
$ cat -n test/example_test.rb 1 require 'test/unit' 2 3 class
ExampleTest < Test::Unit::TestCase 4 def test_apple 5 assert_equal 1, 1 6 end 7 8 def test_banana 9 assert_equal 1, 1 10 end 11 end you wrote:
$ m test/example_test.rb:4 Run options: -n /test_apple/ # Running tests:
. Finished tests in 0.000525s, 1904.7619 tests/s, 1904.7619 assertions/s. 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips run one test:
$ m test/example_test.rb:2 No tests found on line 2. Valid
tests to run: test_apple: m test/examples/test_unit_example_test.rb:4 test_banana: m test/examples/test_unit_example_test.rb:8 wrong line:
$ m test/example_test.rb Run options: # Running tests: .. Finished
tests in 0.001293s, 1546.7904 tests/s, 3093.5808 assertions/s. 1 tests, 2 assertions, 0 failures, 0 errors, 0 skips run it all:
some facts m
works with test-unit, rails, mini-test 1. uses rocco for literate
documentation 2. four months of daily use 3.
how does it work m
programming is not magic
figure out where test methods are 1. match what line
you chose with tests we know about 2. run that test! 3.
__/\\\\____________/\\\\_ _\/\\\\\\________/\\\\\\_ _\/\\\//\\\____/\\\//\\\_ _\/\\\\///\\\/\\\/_\/\\\_ _\/\\\__\///\\\/___\/\\\_ _\/\\\____\///_____\/\\\_ _\/\\\_____________\/\\\_ _\/\\\_____________\/\\\_ _\///______________\///__ gem
install m http://quaran.to/m https://github.com/qrush/m