mirror of
https://github.com/PeterCamilleri/fOOrth
synced 2024-11-16 07:47:56 +01:00
30 lines
No EOL
768 B
Ruby
30 lines
No EOL
768 B
Ruby
# coding: utf-8
|
|
|
|
gem 'minitest'
|
|
require 'minitest/autorun'
|
|
require_relative '../../lib/fOOrth/monkey_patch/numeric'
|
|
require_relative '../../lib/fOOrth/monkey_patch/rational'
|
|
|
|
#Test the monkey patches applied to the Object class.
|
|
class RationalMonkeyPatchTester < MiniTest::Test
|
|
|
|
#Special initialize to track rake progress.
|
|
def initialize(*all)
|
|
$do_this_only_one_time = "" unless defined? $do_this_only_one_time
|
|
|
|
if $do_this_only_one_time != __FILE__
|
|
puts
|
|
puts "Running test file: #{File.split(__FILE__)[1]}"
|
|
$do_this_only_one_time = __FILE__
|
|
end
|
|
|
|
super(*all)
|
|
end
|
|
|
|
#Test that it embeds
|
|
def test_embed
|
|
rat = '1/2'.to_r
|
|
assert_equal(rat.embed, "'1/2'.to_r")
|
|
end
|
|
|
|
end |