Sha256: 0f0943f6db09ac5a8efa68744d64303bf9cce2bec9215be92631a0424bfe82f5
Contents?: true
Size: 658 Bytes
Versions: 16
Compression:
Stored size: 658 Bytes
Contents
require 'minitest/autorun' require 'shenanigans/object/display' require 'stringio' class Display < MiniTest::Unit::TestCase def setup @orig_stdout = $stdout $stdout = StringIO.new("", "r+") end def teardown $stdout = @orig_stdout end def test_display str = "foo" assert str.display == str $stdout.rewind assert $stdout.gets.chomp == str end def test_display_alias str = "foo" assert str.d == str $stdout.rewind assert $stdout.gets.chomp == str end def test_display_no_new_line str = "foo" assert str.display(false) == str $stdout.rewind assert $stdout.gets == str end end
Version data entries
16 entries across 12 versions & 1 rubygems