|
Great article! I think I'm getting the hang of this!
I'm about to subject my class of ~30 unsuspecting students to the first tutorial in this series. (Maybe, if it goes fast enough, the second as well.)
Mino typos: There are missing close parens in category_test.rb test_create_and_destroy:
assert_equal(initial_rec_count + 1, Category.count
and in the same method in recipe_test.rb:
assert_equal(initial_rec_count + 1,Recipe.count
I had to work my way through the following code:
partial_name = ''
'a'.upto('y') {|letter| partial_name << letter}
rec_with_borderline_name = Category.new(:name => (partial_name * 4))
I think the following is clearer, and therefore less distracting from the point you are making:
rec_with_borderline_name = Category.new(:name => ("a" * 100))
Actually, I used
max_length = 100
rec_with_borderline_name = Category.new(:name => ("a" * max_length))
in order to avoid a "magic number." Now, if I can only figure out a way to get that number from the database itself....
Again, great job, and very helpful. Thank you!
|
I apologize for not replying sooner. The O'Reilly feedback system sends emails when folks post, but I obviously missed yours. Thanks for making the time to write and for the feedback. Hope you'll let us know about your class and their reaction!
Best regards,
Bill