Support for testing methods with order they are defined #122

Closed
wants to merge 2 commits into from

3 participants

@SpOOnman

Hi. I've added :defined in test_order method. I like that order as being consistend for me as I watch progress.

@tenderlove
Seattle Ruby Brigade member

Hi, I'm not sure if @zenspider will accept this feature or not, but I'm pretty sure he won't accept it if there are no tests. I think if you add tests for this pull request, it will have a much better chance of being merged.

@SpOOnman

Thank you @tenderlove for your comment. I've just added test covering my pull request.

@zenspider
Seattle Ruby Brigade member

While I don't see a real usecase for this, the impl and tests look good but they fail on 1.8.

@zenspider zenspider was assigned May 9, 2012
@SpOOnman

My real use case is that I write tests with logical order, e. g. for controller functional tests there are four test cases in logical order: no param, empty param, wrong param, right param. Order may be random, because tests don't depend on each other, but I like to keep them in my logical order.

While it works well on ruby 1.9, you're right that it fails on 1.8.7. I made some tests and it looks to me that ruby 1.8.7 doesn't return public_instance_methods in order they are created. I think I cannot fix it on 1.8.7. If you can't find solution I think I have to back off with this pull request.

@zenspider
Seattle Ruby Brigade member
@SpOOnman

I cannot make it work in Ruby 1.8.7 so I close this pull request. I still use it in my projects with Ruby 1.9 locally. Thanks for comments @tenderlove and @zenspider .

@SpOOnman SpOOnman closed this May 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment