Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created April 14, 2011 03:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenderlove/918839 to your computer and use it in GitHub Desktop.
Save tenderlove/918839 to your computer and use it in GitHub Desktop.
require "minitest/autorun"
class ZOMGIO < Struct.new(:io)
def puts str = nil
return io.puts str unless str =~ /\[([\/\w.]+):(\d+)\]:\n/
io.print $`
io.print $&
io.puts "> #{File.readlines($1)[$2.to_i - 1].strip}"
io.puts $'
end
def method_missing msg, *args
io.send(msg, *args)
end
end
MiniTest::Unit.output = ZOMGIO.new(MiniTest::Unit.output)
class TestFuntimes < MiniTest::Unit::TestCase
def test_pass
assert_equal 1, 1
end
def test_sanity
assert_equal 10, 11
end
def test_cannot_be_blank
assert_equal ["can't be blank"], []
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment