After played with rSpec for a while, I have decided to convert BuildMaster on top of it. However, the test2spec script did not work for the project, so after a few experiment, the following regular expression helped me converting the majority of the syntax. I still had to convert the class definition to context definition manually, though.
1. Converting assert_equal(a, b) to b.should_equal a
replace "assert_equal\(([^,]+),\s*([^\n]+)\)" with "$2.should_equal $1"
2. Converting "test_..." methods to "specify ..."
replace "def test_([^\s]+)" to "specify '$1' do"
Subscribe to:
Post Comments (Atom)
2 comments:
Thanks for plugging rspec. What problems did you have w/ test2spec?
David
It didn't say much. Just something like "failed to convert ... file"
I didn't know you were watching ThoughtBlog. Good thing that I didn't ramble on too much on rSpec.
Post a Comment