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

Rails could not find my generator when invoked by aruba #77

Closed
fabn opened this issue Jul 2, 2011 · 2 comments
Closed

Rails could not find my generator when invoked by aruba #77

fabn opened this issue Jul 2, 2011 · 2 comments

Comments

@fabn
Copy link

fabn commented Jul 2, 2011

I'm writing a gem which provides a generator so I tried to writing features using your gem. However I had some trouble with it, Rails can't find my generator when invoked by aruba, if I repeats manually the steps written in Aruba DSL everything works.

This is a failing scenario

Background: A new rails application has been created with my gem
  Given a rails application named "my_app" exists
  And this gem is installed in that application

@announce
Scenario: Installation using default values
  When I successfully run `rails generate my_generator:install`
  # this is needed because rails g returns 0 when can't find the generator
  And the output should not contain "Could not find generator"
  Then a file named "config/initializers/devise.rb" should exist

This is the steps in the Background code

Given /^a rails application named "([^\"]*)" exists$/ do |app_name|
  @app_name = app_name
  Given "I successfully run `rm -rf #{app_name}`" # added to ensure that the working directory is clean
  And "a directory named \"#{app_name}\" should not exist"
  And "I successfully run `rails new #{app_name}`"
  And "I cd to \"#{app_name}\""
end

When /^this gem is installed in that application$/ do
  gempath = File.expand_path('../../../', __FILE__)
  Given "I append to \"Gemfile\" with \"gem 'gem-name', :path => '#{gempath}'\""
  And "I successfully run `bundle check`"
end

If I cd into tmp/aruba/my_app and run rails generate my_generator:install it does work. Moreover my gem uses devise, I tried to debug what's happening, with @announce tag and by putting a When I run "rails g --help" step in my feature and I saw that devise generators are there, but mine is not.

I'm using aruba 0.4.3, cucumber 0.10.7 and rails 3.0.9

I will release the gem on github in a couple of days, so you can see the complete code.

P.S. I have another question, I put it here, and if it's the case I can open another ticket. When I run features they are ran on a dirty working directory (I added a rm -rf my-used-dir before my steps to avoid it), imho your gem should cleanup everything inside the tmp/aruba directory before running features. Don't you think? Am I missing something?

@fabn
Copy link
Author

fabn commented Jul 4, 2011

I've just released my code in which you can reproduce the issue. It's available here

@mattwynne
Copy link
Member

Closing this ticket due to inactivity (sorry nobody responded). Please re-open if it's still a problem.

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