require 'minitest/autorun' require 'widen' class TestWiden < Minitest::Test def test_no_mutation assert_equal 'ABCDE', 'abcde'.upcase.widen assert_equal 'abcde', 'ABCDE'.narrowen.downcase end def test_mutation x = 'abcde'.upcase x.widen! assert_equal 'ABCDE', x x = 'ABCDE'.downcase x.narrowen! assert_equal 'abcde', x end end