[rspec-devel] Simplifying Behaviour in Rspec

David Chelimsky dchelimsky at gmail.com
Wed Jul 25 16:59:58 EDT 2007

On 7/25/07, Brian Takita <brian.takita at gmail.com> wrote:
> I remember that much of Behaviour's complexity put in place to reuse
> Rails fixtures.
> That includes the inherit method and the dynamic class builder.
> BehaviourEval.derive_execution_context_class_from_behaviour_superclass
> Since we now call Test::Unit's setup and teardown in before and after
> blocks, we can compose in a Test::Unit::TestCase instance to call
> setup and teardown on.
> This would make the dynamic class inherit from Test::Unit unnecessary.
> In fact, I don't think there is any other reason to use BehaviorEval
> to create a Dynamic class.
> Since that is the case, we can probably use class and instance methods
> for Behaviour and remove BehaviourEval from the loop.
> This would simplify things.
> What do you all think about this?
> Are there extensions out there that this would break?
> This would be a major change to Rspec's internals, so please speak up.

FYI - Brian and I have discussed this a bit. The only users this might
affect are those who've written extensions that extend or talk
directly to Behaviour or BehaviourEval and anyone who is using the
"inherit" method in examples. My sense is that this should be a VERY
limited group, if any at all. If you are in this group, we need to
hear from you.

The benefits of this change would be enormous, because it would
greatly simplify RSpec's internals, making it much easier to

+1 (at least)


> Thank you,
> Brian
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel

More information about the rspec-devel mailing list