demo of regression test selection
Ruby
Latest commit d628ea5 Feb 13, 2015 @tenderlove seems to be working
Permalink
Failed to load latest commit information.
lib more fixes Feb 13, 2015
spec seems to be working Feb 13, 2015
.gitignore add more stuff Feb 13, 2015
Gemfile add more stuff Feb 13, 2015
Gemfile.lock aset Feb 13, 2015
README.markdown seems to be working Feb 13, 2015
what_to_run.rb more fixes Feb 13, 2015

README.markdown

Regression Test Selection

This is a demo repository for regression test selection. You will need Ruby 2.3 to use this (which is currently trunk Ruby).

Make it go with Minitest

To try it with Minitest, do:

$ COLLECTION=1 ruby -I lib spec/whatever_test.rb

This will create the initial coverage information. Then modify lib/my_thing.rb so that the diff looks like this:

diff --git a/lib/my_thing.rb b/lib/my_thing.rb
index 806deff..eb057b9 100644
--- a/lib/my_thing.rb
+++ b/lib/my_thing.rb
@@ -4,7 +4,7 @@ class Whatever
   end

   def bar
-    "bar #{@foo}"
+    raise
   end

   def baz

Now to predict which tests will fail, do this:

$ ruby what_to_run.rb

Make it go with RSpec

To try it with RSpec, do:

$ COLLECTION=1 rspec spec/whatever_spec.rb

This will create the initial coverage information. Then modify lib/my_thing.rb so that the diff looks like this:

diff --git a/lib/my_thing.rb b/lib/my_thing.rb
index 806deff..eb057b9 100644
--- a/lib/my_thing.rb
+++ b/lib/my_thing.rb
@@ -4,7 +4,7 @@ class Whatever
   end

   def bar
-    "bar #{@foo}"
+    raise
   end

   def baz

Now to predict which tests will fail, do this:

$ ruby what_to_run.rb