Created
July 25, 2013 21:51
-
-
Save scalone/6084110 to your computer and use it in GitHub Desktop.
Test case and Test helper sample to abstract test interface in mtest(MRuby) and test/unit(MRI)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestHelper | |
if Object.const_defined?(:MTest) | |
def self.case | |
engine::TestCase | |
end | |
def self.engine | |
MTest::Unit | |
end | |
def self.run | |
engine.new.run | |
end | |
else | |
require 'test/unit' | |
require File.dirname(__FILE__) + '/../lib/sample.rb' | |
def self.case | |
engine::TestCase | |
end | |
def self.engine | |
Test::Unit | |
end | |
end | |
end | |
class Test4MTest < TestHelper.case | |
def test_assert | |
assert(true) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment