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

Version Path
depengine-0.0.11 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.10 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.9 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.8 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.7 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.5 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.4 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.3 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.2 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.1 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
ptools-1.1.9-x86-mingw32 test/test_null.rb
ptools-1.1.9 test/test_null.rb