I simply want all methods of a module to be always available within
the context of an Example group.

module RSpec
  module Generator
      def with_generator &block
       ...
      end

      def setup_generator test_method_name=nil, &block
        ...
      end
  end
end

How do I achieve this?

In RSpec 1 I think you would use ExampleGroupFactory

I thought I could do it something like this with RSpec 2?

RSpec.configure do |c|
 c.extend RSpec::Generator
end

I want to be able to do something like this

  before :each do
    setup_generator 'migration_generator' do
      tests MigrationGenerator
    end
  end

  it "should generate create_user migration" do
    with_generator do |g|
      ...
  end

Whereas now I have to do it like this, which I find a bit ugly and
cumbersome

  it "should generate create_user migration" do
    RSpec::Generator.with_generator do |g|
      name = 'create_users'
    end
  end

Thanks.
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to