Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[padrino-gen] should create spec/app/spec_helper for sub-apps #1062

Closed
postmodern opened this issue Feb 20, 2013 · 1 comment
Closed

[padrino-gen] should create spec/app/spec_helper for sub-apps #1062

postmodern opened this issue Feb 20, 2013 · 1 comment
Assignees
Milestone

Comments

@postmodern
Copy link
Contributor

When one generates a sub-app, a special test_helper.rb /spec_helperfile should be created which overrides theapp` method used by RackTest.

require 'spec_helper'

def app
  ##
  # You can handle all padrino applications using instead:
  #   Padrino.application
  API.tap { |app|  }
end
@ghost ghost assigned achiurizo Apr 8, 2013
@achiurizo
Copy link
Member

Hm that's an interesting idea. Though this would lead to alot of helpers eventually no?
I've been getting around this by doing something like https://github.com/padrino/padrino-framework/blob/master/padrino-gen/lib/padrino-gen/generators/components/tests/riot.rb#L31.
This allows me to specify in my test something like:

describe "MyController" do
  before do
    app MySubApp.tap { |a| }
  end
  # ...
end

Does this seem like a good solution? If so I can push this to the other generated test/spec helpers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants