I purchased the Ruby Cookbook and I must say it has lots of very good recipes. I decided to use recipe #43 to add some integration tests to one of my projects. However, I kept getting the following error when executing a simple integration test:
ruby test/integration/portfolio_test.rb
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in `const_missing': uninitialized constant IntegrationTest (NameError)
from test/integration/portfolio_test.rb:3
The line in question is:
class PortfolioTest < ActionController::IntegrationTest
I figured out that the problem wasn't in my integration file. So I built a new rails project from scratch (rails test). I tried the same line and it worked fine. I narrowed down the difference to the test_helper.rb files. Using diff I found that the newly build test_helper.rb file had the line require 'test_help' and my original project didn't. I added require 'test_help' to my project's test_helper.rb and everything worked as anticipated.
I think this issue was caused by older version of rails generation.
My New Year's Resolution for 2007 is to keep my wallet in a front pocket. I am already working on this resolution and my back feels great. Placing one's wallet in a front pocket is also a good pick-pocket deterrent. Front pocket wallet placement also avoids unslightly wallet bulge.
What is your resolution for 2007?
When I use test fixtures to populate test data into mysql database I am running into an unexpected behavior. Only columns explicitly defined in the fixture is populated into the database. However, created_on, created_by, updated_on, updated_by fields along with all fields normally populated by observers are NULL. For example, I have a couple fields that have their values calculated via observers. I want to test that these calculations are performed correctly by the observer, so I don't want to hard code their values in the fixture.
Has anyone else run into this issue? If so, how did you perform testing of these fields? I realize that I could perform these tests without fixtures by creating and saving the object. Behind the scenes, Active Record populates all the fields in the expected manner. Then I could find the saved record and assert_equal the expected calculations. However this approach seems brittle and I rather use fixtures. It doesn’t seem (from the results) that I am getting that the fixtures functionality uses Active Record to serialize data to mysql.
Thanks!
I greatly enjoyed reading The Way We Live Now. I received this book as a Christmas gift last year from Mandy's mom. It was a real treat and I am sad the story is over.
Daylight Saving Time Changes in 2007 for US and Canada
Updated 15 December 2006
Beginning in 2007, the United States and Canada are extending Daylight Saving Time (DST) by three weeks in the spring and one week in the fall. DST will begin the second Sunday in March and end the first Sunday in November. Previously, DST began the first Sunday in April and ended the last Sunday in October.
I wonder what impact this date change change will have on computer systems. Handling date / time changes isn't as easy as one would think. On a brighter note, this will allow for a longer waterski season. Woo hoo!
A Guide to Grading Exams. Grading is easy.
Mandy and I went to see Spamalot at the Fisher Theatre in Detriot this past Sunday. I gave Mandy tickets to see Spamalot and Chicago for her birthday. Spamalot was hilarious and I definitely recommend seeing it. The sets were awesome and appeared to be the same ones used on Broadway. The Fisher Building and Theatre showcased the charm and style of the 1920s.
After the show we went to dinner at Traffic Jam & Snug with Terry, Carol, Bev (T's sister), Greg, and Dana. We sampled their blue ribbon cheese selection, which was very tasty. Their wheat microbrew was very smooth, distinctive and enjoyable. Also, their homemade bread with black licorice and sugar was very well received.
Mandy and I went to the Marathon Christmas party on Saturday evening. We started with a pre-party at Nicole and Gille's ranch. Mandy made sure that we weren't too fashionably late so we could enjoy all the fixings that go with the chocolate fountains. Last year we were a little late and they ran out of angel food cake and strawberries. I wasn't too worried since Marathon has had a remarkable year. The food was wonderful and there were no shortages.
Merry Christmas!
Mandy and I attended three Christmas parties this weekend. First, we attended the Glass City Waterski party in Toledo. It was a great time and was especially amusing to get updates from the teenagers that became severely stuck illegally four wheeling around Chrissy road. They called a tow truck after sinking in the mud a 1/2 mile off the road. The tow truck was able to free them. However, the tow truck became hopelessly stuck and they proceeded to the party leaving the tow truck driver to fend for himself. Second, we attended a family party in West Milton on Saturday evening. It was fun, but I had a nasty case of food coma from overgrazing the fine selection of holiday concoctions. I barely had enough energy to see Doug's band play (late night) in Findlay. Doug broke another cymbal. He has been on quite a roll. He totalled his car by hitting a 6-point buck earlier in the week. Third, we attended a family party at the Tea House in Tiffin. It was another great meal with family!
Before I forget, my dad and I shot trap on Thursday and I hit 20 out of 25 achieving a new personal best. Woo Hoo!
Today, a senior Gartner Group consultant was in to do a presentation about the future of the IT workplace / workforce. The Gartner Group is famous for presenting four quadrant graphs that measure two variables. Before this Gartner consultant could get to the magic quadrant graphs and top ten lists he ran into a couple problems.
He asked that his PowerPoint slide deck be moved ahead to the next slide. It was pointed out that he had a remote to navigate the PowerPoint slide deck. He futilely tried to use the remote and even after instruction in front of the entire audience he wasn't able to master it. A keyboard was made accessible and he was ready to rock and roll through the magic quadrants contained in his PowerPoint. Things were beginning to roll along nicely when his cell phone rang and interrupted his momentum. He stopped the ringing, apologized, and continued on.
Several minutes later his phone rang yet again. This time he dug it out and I think he properly silenced it since it was no further bother. He regained his composure and continued on. Finally, he announced that the final slide would nicely sum up his entire presentation. Before he could crown all the major points from the magic quadrants on the summary slide he hit the wrong button and fast rewound into the prior presenter’s slide deck. Quickly trying to find the proper slide he continued to navigate backwards through each slide. He was unable to find his summary slide since it was at the opposite end of the slide deck. A kind soul went up and assisted him in finding that summary slide.
This reminded me that Mandy has do a PowerPoint project for the class she is taking for her school certification. I wonder why over-priced consultants don't have the same requirement.