Sha256: 63733a968ed0cea1e11aaa9120485e2ba449f811ed1c449a7495ee63aa6d5703
Contents?: true
Size: 927 Bytes
Versions: 32
Compression:
Stored size: 927 Bytes
Contents
##################################################################### # test_null.rb # # Test case for the File.null method. You should run this test via # the 'rake test_null' task. ##################################################################### require 'test/unit' require 'ptools' class TC_Null < Test::Unit::TestCase def setup @nulls = ['/dev/null', 'NUL', 'NIL:', 'NL:'] end def test_null_basic assert_respond_to(File, :null) assert_nothing_raised{ File.null } end def test_null_expected_results assert_kind_of(String, File.null) assert(@nulls.include?(File.null)) end def test_null_expected_errors assert_raises(ArgumentError){ File.null(1) } end def test_null_device_alias assert_respond_to(File, :null_device) assert_equal(true, File.method(:null) == File.method(:null_device)) end def teardown @nulls = nil end end
Version data entries
32 entries across 32 versions & 2 rubygems