Skip to content

Instantly share code, notes, and snippets.

@basicxman
Created August 19, 2011 16:06
Show Gist options
  • Select an option

  • Save basicxman/1157199 to your computer and use it in GitHub Desktop.

Select an option

Save basicxman/1157199 to your computer and use it in GitHub Desktop.
unless Object.const_defined? 'Minecraft'
$:.unshift File.expand_path("../../lib", __FILE__)
require "minecraft"
end
require "minitest/autorun"
require "fileutils"
require "open3"
class Test < MiniTest::Unit::TestCase
BIN = "ruby " + File.expand_path("../../bin/minecraft", __FILE__)
def self.test(name, &block)
p = Proc.new do
FileUtils.mkdir("mc") unless File.exists? "mc"
FileUtils.cd("mc") do
block.call
end
end
define_method("test_#{name.gsub(/\W/, '_')}", p)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment