From 06c47eb2842d3bbea9909f2d55d5f3fb66b3c27e Mon Sep 17 00:00:00 2001 From: Rene Mendoza Date: Wed, 25 Aug 2010 17:58:14 -0500 Subject: [PATCH] Added autotest support and added colorized output of tests --- koans/autotest/discover.rb | 3 +++ koans/autotest/rubykoan.rb | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 koans/autotest/discover.rb create mode 100644 koans/autotest/rubykoan.rb diff --git a/koans/autotest/discover.rb b/koans/autotest/discover.rb new file mode 100644 index 0000000..31a7804 --- /dev/null +++ b/koans/autotest/discover.rb @@ -0,0 +1,3 @@ +Autotest.add_discovery do + "rubykoan" if File.exist? 'path_to_enlightenment.rb' +end diff --git a/koans/autotest/rubykoan.rb b/koans/autotest/rubykoan.rb new file mode 100644 index 0000000..d43dc91 --- /dev/null +++ b/koans/autotest/rubykoan.rb @@ -0,0 +1,24 @@ +require 'autotest' + +class Autotest::Rubykoan < Autotest + def initialize + super + @exceptions = /\.txt|Rakefile|\.rdoc/ + + self.order = :alpha + self.add_mapping(/^about_.*rb$/) do |filename, _| + filename + end + + end + + def make_test_cmd files_to_test + "#{ruby} 'path_to_enlightenment.rb'" + end + + # quiet test/unit chatter + def handle_results(results) + end + +end +