Added autotest support and added colorized output of tests
authorRene Mendoza <latiendamac@gmail.com>
Wed, 25 Aug 2010 22:58:14 +0000 (17:58 -0500)
committerJim Weirich <jim.weirich@gmail.com>
Fri, 27 Aug 2010 13:37:33 +0000 (09:37 -0400)
koans/autotest/discover.rb [new file with mode: 0644]
koans/autotest/rubykoan.rb [new file with mode: 0644]

diff --git a/koans/autotest/discover.rb b/koans/autotest/discover.rb
new file mode 100644 (file)
index 0000000..31a7804
--- /dev/null
@@ -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 (file)
index 0000000..d43dc91
--- /dev/null
@@ -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
+