Sha256: cd33d3da7322d0a1fed0ef8271e8787d451300b3187dbc822d9d8b7e5af76062

Contents?: true

Size: 756 Bytes

Versions: 39

Compression:

Stored size: 756 Bytes

Contents

require 'test/unit'
require 'radius'

class RadiusUtilityTest < Test::Unit::TestCase
  
  def test_symbolize_keys
    h = Radius::Utility.symbolize_keys({ 'a' => 1, :b => 2 })
    assert_equal h[:a], 1
    assert_equal h[:b], 2
  end
  
  def test_impartial_hash_delete
    h = { 'a' => 1, :b => 2 }
    assert_equal Radius::Utility.impartial_hash_delete(h, :a), 1
    assert_equal Radius::Utility.impartial_hash_delete(h, 'b'), 2
    assert_equal h.empty?, true
  end
  
  def test_constantize
    assert_equal Radius::Utility.constantize('String'), String
  end
  
  def test_camelize
    assert_equal Radius::Utility.camelize('ab_cd_ef'), 'AbCdEf'
  end

  def test_array_to_s
    assert_equal Radius::Utility.array_to_s(['a', 1, [:c]]), 'a1c'
  end
end

Version data entries

39 entries across 39 versions & 4 rubygems

Version Path
depengine-0.0.31 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.30 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.29 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.28 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.27 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.26 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.25 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.24 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.23 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.22 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.21 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.20 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.19 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.18 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.17 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.16 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.15 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.14 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.13 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb
depengine-0.0.12 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/utility_test.rb