Sha256: 28ca322cbeb77029e4124810d8704c25b737c5da6e02ee372decc0afd3746a56
Contents?: true
Size: 583 Bytes
Versions: 16
Compression:
Stored size: 583 Bytes
Contents
require 'facets/string/to_re' require 'test/unit' class TestStringToRe < Test::Unit::TestCase def test_to_re assert_equal( /abc/, "abc".to_re ) assert_equal( /a+bc/, "a+bc".to_re ) assert_equal( /a+bc/, "a+bc".to_re(false) ) assert_equal( /a\+bc/, "a+bc".to_re(true) ) end def test_to_rx assert_equal( /abc/, "abc".to_rx ) assert_equal( /a\+bc/, "a+bc".to_rx ) assert_equal( /a+bc/, "a+bc".to_rx(false) ) assert_equal( /a\+bc/, "a+bc".to_rx(true) ) end def test_to_rx2 a = "?" b = /#{a.to_rx}/ assert( b =~ "?" ) end end
Version data entries
16 entries across 16 versions & 1 rubygems