Sha256: 82acdc53a5b9884bd8f4c29a65997d5098c3a1dc467c73699fff51e3e0d3a12e
Contents?: true
Size: 992 Bytes
Versions: 17
Compression:
Stored size: 992 Bytes
Contents
##################################################################### # test_null.rb # # Test case for the File.null method. You should run this test via # the 'rake test_null' task. ##################################################################### require 'rubygems' gem 'test-unit' require 'test/unit' require 'ptools' class TC_FileNull < Test::Unit::TestCase def setup @nulls = ['/dev/null', 'NUL', 'NIL:', 'NL:'] end test "null method basic functionality" do assert_respond_to(File, :null) assert_nothing_raised{ File.null } end test "null method returns expected results" do assert_kind_of(String, File.null) assert(@nulls.include?(File.null)) end test "null method does not accept any arguments" do assert_raises(ArgumentError){ File.null(1) } end test "null_device is an alias for null" do assert_respond_to(File, :null_device) assert_alias_method(File, :null_device, :null) end def teardown @nulls = nil end end
Version data entries
17 entries across 17 versions & 1 rubygems