[rspec-devel] Regarding DSL::Configure

Evgeny evgeny.zislis at gmail.com
Sun Jul 22 13:34:31 EDT 2007


Greetings rSpec developers!

According to rSpec documentation, in Spec::Runner.configuration I am
able to include various helpers to my behaviors. Like so:
  config.include ActionView::Helpers, :behaviour_type => :helpers

So I wanted to do something like :

   config.with_options :behaviour_type => :helpers do |config|
    config.include Haml::Helpers
    config.include ActionView::Helpers
    config.prepend_before :all do
      @haml_is_haml = true
      @haml_stack = [Haml::Buffer.new]
    end
  end

Which is supported in Rails (Object#with_options), since this seems to
be quite DRY and logical. But it didn't work, because config.include
doesn't accept hashes (thats the error anyway).

Using rSpec 1.05.

Anyone else thinks this is a good idea, and should work?

Anyone knows whats the problem and why its broken?


More information about the rspec-devel mailing list