RSpec does not provide anything like this (it is agnostic about what source
control system you are using, if any).

You could write a script to query git for the list of files that have
changed since last commit, and pass the spec files in that list to the
`rspec` command.

HTH,
Myron

On Sun, Apr 9, 2017 at 1:51 PM, Alon Dahari <[email protected]> wrote:

> Hi,
> I have a pre-commit hook on my project to run my rspec tests and prevent
> commit on failures.
> As the project grows, running the tests is getting slower.
> Is there a way to run only tests that touch files changed since last
> commit (staged files)?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "rspec" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/rspec/50c0145b-36d4-431a-a6d5-4d7faf8e87a9%40googlegroups.com
> <https://groups.google.com/d/msgid/rspec/50c0145b-36d4-431a-a6d5-4d7faf8e87a9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/CADUxQmt4aqch%2BK0bcQWr1W1rSwfqQn%2Bmb4HVg4X34-FrGdX8ag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to