Added autotest support to RubyKoans
This commit is contained in:
committed by
Jim Weirich
parent
1f6c0e03a5
commit
ed2ef0f439
2
Rakefile
2
Rakefile
@@ -29,6 +29,8 @@ module Koans
|
||||
def Koans.make_koan_file(infile, outfile)
|
||||
if infile =~ /edgecase/
|
||||
cp infile, outfile
|
||||
elsif infile =~ /autotest/
|
||||
cp_r infile, outfile
|
||||
else
|
||||
open(infile) do |ins|
|
||||
open(outfile, "w") do |outs|
|
||||
|
||||
3
src/autotest/discover.rb
Normal file
3
src/autotest/discover.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
Autotest.add_discovery do
|
||||
"rubykoan" if File.exist? 'path_to_enlightenment.rb'
|
||||
end
|
||||
24
src/autotest/rubykoan.rb
Normal file
24
src/autotest/rubykoan.rb
Normal file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user