Sha256: a055f3fc0902b9c7a83bd8812c295b2a13d812b275f65a049c47b78a761b57f0

Contents?: true

Size: 840 Bytes

Versions: 3

Compression:

Stored size: 840 Bytes

Contents

require 'helper'

class TestUriHandler < Test::Unit::TestCase
  should 'pass back the encoded string "testing 123" as "testing+123"' do
    assert_equal 'testing+123', 'testing 123'.to_uri
    assert_equal 'testing+123', 'testing 123'.uri_encode
  end
  
  should 'pass back the decoded string "testing+123" as "testing 123"' do
    assert_equal 'testing 123', 'testing+123'.uri_decode
  end
  
  should 'replace the string variable\'s value with the equivalent encoded value' do
    val = 'testing 123'
    val.to_uri!
    
    assert_equal 'testing+123', val
    
    val = 'testing 123'
    val.uri_encode!
    
    assert_equal 'testing+123', val
  end
  
  should 'replace the string varialbe\'s value with the equivalent decoded value' do
    val = 'testing+123'
    val.uri_decode!
    
    assert_equal 'testing 123', val
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
uri-handler-1.0.2 test/test_uri-handler.rb
uri-handler-1.0.1 test/test_uri-handler.rb
uri-handler-1.0.0 test/test_uri-handler.rb