Reputation: 16393
The test changes gem looks useful and lightweight. What would be an example .test-changes.yml
file that would be useful for a typical rails application?
Upvotes: 0
Views: 31
Reputation: 1394
I'm the author of the test_changes gem. Here's a snippet of the configuration file I'm using for our Rails/RSpec app:
rspec:
finding_patterns:
^app/(.+)\.rb: spec/\1_spec.rb
^lib/(.+)\.rb: spec/lib/\1_spec.rb
^spec/(.+)_spec.rb: spec/\1_spec.rb
That's pretty much all you need to get started :)
test_changes
is also useful for tying a module or support file to multiple tests. For example, we have something like this:
rspec:
finding_patterns:
^app/concerns/mobile_site.rb:
- spec/acceptance/sign_in_spec.rb
- spec/acceptance/sign_up_spec.rb
^spec/factories/product_factory.rb:
- spec/acceptance/orders_admin_spec.rb
- spec/models/product_spec.rb
Hope that helps!
Upvotes: 1