Sha256: 557fe65af7079da2f6f319ac39776c87782f3b79772d0d47e9585a83089fa71c
Contents?: true
Size: 876 Bytes
Versions: 3
Compression:
Stored size: 876 Bytes
Contents
$test_lib_dir = File.join(File.dirname(__FILE__), "..", "lib") $:.unshift($test_lib_dir) require "test/unit" require "constants" require "longurl/exceptions" require "longurl/service" class TestService < Test::Unit::TestCase def setup @service = LongURL::Service.new end def test_query_should_raise_invalid_url_if_url_is_nil assert_raise(LongURL::InvalidURL) { @service.query(nil) } end def test_query_should_raise_invalid_url_if_url_is_empty assert_raise(LongURL::InvalidURL) { @service.query('') } end def test_query_should_returns_given_url_if_not_shorten_url assert_equal "http://www.google.com", @service.query("http://www.google.com") end def test_query_should_returns_expanded_url_for_supported_services ShortToLong.each_value {|service| service.each {|short, long| assert_equal long, @service.query(short)}} end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
jakimowicz-longurl-0.1.1 | test/service/service_test.rb |
longurl-0.1.0 | test/service/service_test.rb |
longurl-0.1.1 | test/service/service_test.rb |