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

Version Path
ptools-1.3.7 test/test_null.rb
ptools-1.3.6 test/test_null.rb
ptools-1.3.5 test/test_null.rb
ptools-1.3.4 test/test_null.rb
ptools-1.3.3 test/test_null.rb
ptools-1.3.2 test/test_null.rb
ptools-1.3.2-universal-mingw32 test/test_null.rb
ptools-1.3.1 test/test_null.rb
ptools-1.3.0 test/test_null.rb
ptools-1.2.7 test/test_null.rb
ptools-1.2.6 test/test_null.rb
ptools-1.2.4 test/test_null.rb
ptools-1.2.4-universal-mingw32 test/test_null.rb
ptools-1.2.3-universal-mingw32 test/test_null.rb
ptools-1.2.3 test/test_null.rb
ptools-1.2.2 test/test_null.rb
ptools-1.2.1 test/test_null.rb