Tagged Questions
11
votes
4answers
4k views
How to effectively unit test a controller in Ruby on Rails (please critique a sample RSpec)
I intend this to be a general question on writing an effective set of test cases for a controller action. I include the following ingredients:
Ruby on Rails
RSpec: A testing framework. I considered ...
3
votes
1answer
102 views
Can this custom Test:Unit assert be replaced/refactored? Am I missing test cases?
I have a unit test that needs to compare two arrays but it shouldn't care about the order of the arrays. I didn't see anything in the Test:Unit docs that provided this so I wrote my own. I really ...
2
votes
3answers
1k views
Ruby code style / Regular Expression to remove blank lines / test case
Forgive me to put 3 seemingly irrelevant words in the subject line. But
they are the purposes of this post.
This is basically my first Ruby class, which is to remove all empty
lines and blank times ...