Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Standup 9/1/2010 – Rspec2 + RubyMine and Testing for Class methods

Glenn Jahnke
Wednesday, September 1, 2010

Help

Testing for class methods in Ruby

How do you test for the existence of a class method? Test it using #respond_to?

class Foo
    def self.bar
        puts "Hello, World!"
    end
end

Foo.respond_to?(:bar)
 => true

And to make sure we are really just talking about class methods and not instance methods:

foo = Foo.new

foo.respond_to?(:bar)
 => false

Interesting

RubyMine and Rspec2 Bug Fixed!

We use the latest and greatest RubyMine version available at Pivotal, but sometimes technology choices such as Rails 3 and Rspec 2 are still ahead of it. The formatter that analyzes test output breaks on Rspec 2′s output before any tests run. The bug is further discussed http://youtrack.jetbrains.net/issue/RUBY-6485. Luckily this bug will be fixed in the next EAP release.

Excuting .rvmrc commands and cruisecontrol

We’ve had a difficult time getting .rvmrc files to work with cruisecontrol.rb builds. Specifically, ccrb seems to launch the rake task in the project working directory. This means that the .rvmrc file is ignored. A workaround is to have your CI script directly use RVM or to add “cd .. && cd work” before your project cruise script or rake task.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Add New Comment Cancel reply

Your email address will not be published.

Glenn Jahnke

Glenn Jahnke
San Francisco

Recent Posts

  • 7/13/2012 – Happy Friday
  • iOS Acceptance and Ruby Keywords
  • Standup 1/9/2012
Subscribe to Glenn's Feed

Author Topics

rails (3)
ios (1)
ruby (8)
testing (1)
javascript (4)
jenkins (2)
tdd (2)
scala (2)
rubymine (2)
mysql (1)
agile (5)
iteration planning meetings (1)
performance (1)
jasmin (2)
rspec (1)
data processing (1)
cruisecontrol (1)
rvm (1)
android (1)
mobile (1)
mongodb (1)
concurrent programming (1)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >