- #!/usr/bin/env ruby
- file = ARGV[0]
- `cd #{ENV['PWD']}`
- if file =~ /_test\.rb/
- output = `cd #{ENV['PWD']} && ruby -Itest #{ARGV[0]}`
- else
- file = File.basename(file).gsub(/.rb/, '')
- match = Dir["#{ENV['PWD']}/test/**/*.rb"].each do |f|
- m = File.basename(f)
- if m == "#{file}_test.rb"
- output = `cd #{ENV['PWD']} && ruby -Itest #{f}`
- end
- end
- end
- puts output.gsub(/\[42;37;1m|\[0m|\[33;1;40mE|\[33;1;40m/, '')