Related to using SimpleCov but to track only the changed files, below is a
snippet I used in our projects:
if ENV['COV']
require 'simplecov'
SimpleCov.start 'rails' do
add_group 'This Commit' do |source_file|
`git ls-files --exclude-standard --others \
&& git diff --name-only \
&& git diff --name-only --cached`.split("\n").detect do |filename|
source_file.filename.ends_with?(filename)
end
end
base_commit = `git merge-base master HEAD`.chomp
add_group 'This Branch' do |source_file|
`git diff #{base_commit}..HEAD --name-only`.split("\n").detect do
|filename|
source_file.filename.ends_with?(filename)
end
end
end
end
On Wednesday, 30 December 2015 22:43:40 UTC+11, Tom Hale wrote:
>
> Hi all,
>
> In the project I'm working on, I'm noticing methods creeping in during
> refactoring that aren't covered in the specs.
>
> What workflows, practices and/or tools do you use to ensure that all
> methods have a spec?
>
> Merry New Year and Happy Christmas :)
>
--
You received this message because you are subscribed to the Google Groups "Ruby
or Rails Oceania" 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].
Visit this group at https://groups.google.com/group/rails-oceania.
For more options, visit https://groups.google.com/d/optout.