Skip to content

Commit

Permalink
added test helper
Browse files Browse the repository at this point in the history
  • Loading branch information
koljakube committed Jun 14, 2012
1 parent 8508503 commit 4947777
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# encoding: utf-8

require 'minitest/unit'
require 'minitest/autorun'
require 'minitest/pride'

require_relative '../lib/statik'

class TestCase < MiniTest::Unit::TestCase
include MassRename

class << self
alias_method :old_test, :test

def test(name, &block)
name = "test_#{name.gsub(/[^\w ]/, '').gsub(' ', '_')}"
define_method name, &block
end

def setup(&block)
define_method :setup, &block
end

def teardown(&block)
define_method :teardown, &block
end
end
end

0 comments on commit 4947777

Please sign in to comment.