aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_math.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_math.rb')
-rw-r--r--test/ruby/test_math.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb
new file mode 100644
index 0000000000..15537159a3
--- /dev/null
+++ b/test/ruby/test_math.rb
@@ -0,0 +1,14 @@
+require 'test/unit'
+
+$KCODE = 'none'
+
+class TestMath < Test::Unit::TestCase
+ def test_math
+ assert(Math.sqrt(4) == 2)
+
+ self.class.class_eval {
+ include Math
+ }
+ assert(sqrt(4) == 2)
+ end
+end