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

how to use autotest with steak? #34

Closed
ZhangHanDong opened this issue Mar 4, 2011 · 3 comments
Closed

how to use autotest with steak? #34

ZhangHanDong opened this issue Mar 4, 2011 · 3 comments

Comments

@ZhangHanDong
Copy link

how to use autotest with steak?

@jcxplorer
Copy link
Contributor

Please ask questions on the mailing list. This is reserved for bug reports.

To answer your question, if you want to run your steak specs on any change to a Rails app, your autotest/discover.rb file can be something like:

Autotest.add_discovery { "rails" }
Autotest.add_discovery { "rspec2" }

Autotest.add_hook :initialize do |at|
  at.add_mapping(/^spec\/acceptance\/.*_spec.rb$/) { |f| f }
end

@ZhangHanDong
Copy link
Author

i got it, thank you!

@ZhangHanDong
Copy link
Author

your config doesn't work!

it should be like the following:

Autotest.add_discovery { "rails" }
Autotest.add_discovery { "rspec2" }

Autotest.add_hook :initialize do |at|
  at.add_mapping(%r%^spec/acceptance/.*_spec.rb$%, true) { |filename, _|
    filename
  }

  at.add_mapping(%r%^app/(models|controllers|helpers|lib)/.*rb$%, true) {
    at.files_matching %r%^spec/acceptance/.*_spec.rb$%
  }

  at.add_mapping(%r%^app/views/(.*)$%, true) {
    at.files_matching %r%^spec/acceptance/.*_spec.rb$%
  }
end

This issue was closed.
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