Guest User

Untitled

a guest
Jun 26th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. file = ARGV[0]
  4. `cd #{ENV['PWD']}`
  5. if file =~ /_test\.rb/
  6. output = `cd #{ENV['PWD']} && ruby -Itest #{ARGV[0]}`
  7. else
  8. file = File.basename(file).gsub(/.rb/, '')
  9. match = Dir["#{ENV['PWD']}/test/**/*.rb"].each do |f|
  10. m = File.basename(f)
  11. if m == "#{file}_test.rb"
  12. output = `cd #{ENV['PWD']} && ruby -Itest #{f}`
  13. end
  14. end
  15. end
  16.  
  17.  
  18. puts output.gsub(/\[42;37;1m|\[0m|\[33;1;40mE|\[33;1;40m/, '')
Advertisement
Add Comment
Please, Sign In to add comment