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.31 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.30 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.29 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.28 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.27 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.26 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.25 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.24 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.23 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.22 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.21 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.20 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.19 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.18 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.17 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.16 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.15 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.14 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.13 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb
depengine-0.0.12 etc/isolate/ruby-1.8/gems/ptools-1.1.9/test/test_null.rb