Rakefile in activefacts-compositions-1.9.6 vs Rakefile in activefacts-compositions-1.9.8
- old
+ new
@@ -19,5 +19,38 @@
end
end*''
)
end
end
+
+desc "Display differences between expected and actual from the last test run"
+task :actual do
+ system <<-END
+ for actual in `find spec -type d -name actual`
+ do
+ base=`dirname "$actual"`
+ files="`ls $base/actual/* 2>/dev/null`"
+ if [ x"$files" != x"" ]
+ then
+ echo "=================================== $base ==================================="
+ diff -rub $base/expected/ $base/actual |grep -v '^Only in .*expected'
+ fi
+ done
+ END
+end
+
+desc "Accept the last actual test output, making it expected for the next test run"
+task :accept do
+ system <<-END
+ for actual_dir in `find spec -type d -name actual`
+ do
+ base=`dirname "$actual_dir"`
+ expected=`cd "$base/expected"; git ls-files`
+ actual=`cd "$base/actual"; ls $expected 2>/dev/null`
+ if [ x"$actual" != x"" ]
+ then
+ echo "Accepting $actual"
+ (cd "$base/actual"; mv $actual ../expected)
+ fi
+ done
+ END
+end