Vijay's blog



VijayVijay
Standup 10/2/2008: rspec running describes in order
edit Posted by Vijay on Thursday October 02, 2008 at 05:31PM

Interesting Things

  • Rspec - stubbing a class method

In Rspec you can stub a class method in a module using Module::Class:Stubs('method') similar to Mocha syntax stub! does not work for Module::Class:method in rspec

  • Rspec - running test in order

If someone knows of a way to run describes in order in rspec test, please let me know

Ask for Help

"Finder conditions in rails?"

    find(:all, :conditions => 'flag is null')  where flag is boolean

This would work in tests but not in development mode. They tried changing it to

    find(:all, :conditions => 'flag != 1')  where flag is boolean

and this would work in dev mode but not in test.

Try having boolean values in database as not null and never pass null to boolean. Make sure fixtures and development data have similar data sets.

"Selenium tests failing to load associations"

Check if you RAILS_ENV is set to test while running Selenium. There has been some cases of weird rails behavior running tests when RAILS_ENV is set to development

VijayVijay
Standup 10/01/2008: where is the to_date function in ruby/rails world?
edit Posted by Vijay on Wednesday October 01, 2008 at 05:40PM

Interesting Things

  • One of the teams was trying to reopen the Time class to make to_date public. Another pivot noticed that there is no built in to_date in Time class in ruby. ActiveSupport has a to_date method on Time class that is public. The most interesting one is that there is a private to_date that is added to Time class when you include Yaml.

  • We have git brown bag today on how to use git with the Pivotal Process.

Other stuff

  • We are looking for one more unix system administrator preferably with scalability experience to help with our infrastructure. The job description is here. Well there are obvious benefits and then there is also free breakfast :)

VijayVijay
Standup 09/30/2008: svn log slowness; tech talk videos
edit Posted by Vijay on Tuesday September 30, 2008 at 04:49PM

Interesting Things

  • svn log takes a long time when you have recently committed a large number such as 5000 files. Specifically, this happens when you have path based security. Here's a link from the subversion documentation that mentions this

    All of this path-checking can sometimes be quite expensive, especially in the case of svn log. When retrieving a list revisions, the server looks at every changed path in each revision and checks it for readability. If an unreadable path is discovered, then it's omitted from the list of the revision's changed paths (normally seen with the --verbose option), and the whole log message is suppressed. Needless to say, this can be time-consuming on revisions that affect a large number of files

  • Check out the new links at pivotallabs.com

    • Talks lists all the tech talks that happen here at Pivotal such as Blaine Cook's Fire Eagle talk. If you have some cool technology and would like to give a talk, contact us at techtalks@pivotallabs.com
    • Who lists all the great people who work here