maltize/sublime-text-2-ruby-tests — pull request #32 by hpathan (2012-01-18 19:29:28+00:00)
Title: Enabling single unit test execution for shoulda tests

For Shoulda tests, single test execution returns 'No test name!', I have added TestMethodMatcher to look at UnitTest and ShouldaTest and return test name accordingly to run -n option against it.

So now single test execution would run for following shoulda tests too:

Sample test case:

context "show" do
should "...." do
get :show, ....
assert_equal "something","something"
end
end

It will not work for test files which has both shoulda and def syntax. It would not behave correctly, because we try to match regular expression. So it will find the first match and run that test. This would probably happen for legacy applications where developers are adding shoulda. But it would work perfect if all the tests are using shoulda and its context