Describe Scopes Parent Class #9

Closed
wants to merge 6 commits into
from

Conversation

Projects
None yet
6 participants

I would like to use the spec DSL inside my own parent class which may include helpers, etc. Here is a an example. https://gist.github.com/793330

This small change allows the describe_stack to set the first class to the parent class if it is a subclass of MiniTest::Spec before falling back to MiniTest::Spec itself. This way testers can subclass MiniTest::Spec with their own helpers and presumable their own framework on top of MiniTest::Spec without extending the base.

gunn commented on 5149de3 Dec 17, 2010

Well, I can confirm with this update, I no longer get any errors with 'rake test'.

Owner

zenspider replied Dec 17, 2010

Yeah... sorry about that. p4 -> git sync script apparently has a bug.

zenspider and others added some commits Dec 23, 2010

@zenspider @zenspider zenspider - Benchmarks in specs that didn't call bench_range would die. (zzak).
+ Completed doco on minitest/benchmark for specs.
[git-p4: depot-paths = "//src/minitest/dev/": change = 6086]
a1cd13d
@zenspider Steven R. Baker Add RDoc for MiniTest::Mock
[git-p4: depot-paths = "//src/minitest/dev/": change = 6089]
fb2667a
@zenspider @zenspider zenspider prepped for release
[git-p4: depot-paths = "//src/minitest/dev/": change = 6093]
7de1db0
@zenspider @zenspider zenspider - Fixed a new warning in 1.9.3.
[git-p4: depot-paths = "//src/minitest/dev/": change = 6095]
25dea9f
@metaskills metaskills Allow class scopes to be used with spec dsl. e7cde5b

rmm5t commented Jan 24, 2011

+1 I would have expected MiniTest::Spec to behave the same way that gist intended it to.

good luck but i doubt you're going to get much love from here. from the seattlerb profile page "HEY! We do NOT develop in git, so pull requests will be rejected. Submit patches via the bug reporter on rubyforge.org." personally i'll just continue keeping a fork up to date and manually applying your patch as long as possible...

I did create a ticket on rubyforge and linked the diff to this page.

And if that is not enough I just created a "patch" on the "tracker" of rubyforge. C'mon :) Aaron told me he would ask Ryan Davis if he could get on this since he finally started moving rails tests over to MiniTest::Spec as well and the first person that tried to use a describe blog would go WTF.

+1 especially after seeing this gist: https://gist.github.com/821558

Owner

zenspider commented Mar 4, 2011

@joslynesser: that gist works w/o this patch just fine, so I don't see what your point is.

Owner

zenspider commented Mar 4, 2011

@metaskills: I can't read/understand wtf is going on with this pull request. I took your tests and completely munged them into a proper reflective test (like test_structure) and made it pass.

The gist above posted by @joslynesser does work without the patch, but that is not the point. As I told @tenderlove, it will break the first time you try to use a helper in a describe block, for example "people(:one)" in a describe block will be a NoMethodError.

@zenspider Agreed, not sure WTF is happening with the pull request. This was my simple commit in my repo.

metaskills/minitest@e7cde5b

@zenspider: Sorry I didn't clarify. I meant to +1 this pull because of meta's comments in that gist, not that the gist itself failed.

zenspider locked and limited conversation to collaborators May 17, 2017

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.