Every so often, someone forgets to remove p() statements from their Ruby specs and then checks in. Figuring out where those p()s are afterward is a pain in the neck.
Here's a simple solution: the whiny p.Drop this little snippet into your def p(*args)
super *(args << caller[0])
endspec_helper.rb or test_helper.rb and all your p() statements will also print the line number from which they are invoked. Pretty cool, what?
Tuesday, November 18, 2008
Don't misplace your p()s
Subscribe to:
Post Comments
(Atom)
Tag Cloud
- .net
- activ
- activeresource
- agile
- ajax
- analysis
- announcement
- anti-pattern
- architecture
- bangalore
- bangpypers
- barcamp
- barcampbangalore4
- barcampbangalore5
- bcb4
- blogger
- book review verdict:read
- books
- browser
- brug
- bug
- call
- cc.rb
- ci
- conference
- content repository
- continuous integration
- cool
- css
- cycle
- darkness
- DCB1
- dcb2
- deployment
- devcampbangalore
- digg
- dining table
- django
- dragdrop
- dzone
- enterprise
- event
- evolving
- feedburner
- feedflare
- feedflareunit
- fun
- functional programming
- GI
- gotcha
- gwt
- hack
- hackdayindia
- howto
- humour
- ide
- india
- innovative
- intellij
- interview
- intro
- irc
- jackrabbit
- java
- javaone
- javascript
- jcr
- jquery
- jruby
- JSNI
- junction
- leisure
- links
- literature
- lucene
- mac
- metaprogramming
- methodology
- microsoft
- mingle
- mochikit
- mongrel
- musings
- mvc
- nasscom
- news
- noob
- OOP
- opinion
- oss
- osx
- performance
- photo
- plugin
- practices
- programming
- prototype
- python
- quality
- quirks
- rails
- rant
- rdt
- recruiting
- recruitment
- refactoring
- registry
- release
- resharper
- REST
- ruby
- rubyconf
- scala
- search
- security
- spawn
- symlinks
- sysinternals
- tdd
- testing
- thoughtworks
- tibco
- tomcat
- tool
- training
- tw
- twb
- tweak
- unconference
- undernet
- utf8
- versioning
- video
- web
- windows
- wrest
- xp
- YUI







0 comments:
Post a Comment