test/tc_shorturl.rb in shorturl-0.1.0 vs test/tc_shorturl.rb in shorturl-0.2.0
- old
+ new
@@ -22,10 +22,17 @@
def test_shorten
assert ShortURL.shorten(@url) == "http://rubyurl.com/Q9ToW"
assert ShortURL.shorten(@url, :rubyurl) == "http://rubyurl.com/Q9ToW"
assert ShortURL.shorten(@url, :tinyurl) == "http://tinyurl.com/9mop8"
+
+ # The short URL for shorl is never the same, so I just check to
+ # see if the URL begins with their domain name
+ assert ShortURL.shorten(@url, :shorl) =~ /^http:\/\/shorl.com\//
+ assert ShortURL.shorten(@url, :snipurl) == "http://snipurl.com/fbkl"
+ assert ShortURL.shorten(@url, :metamark) == "http://xrl.us/ga8c"
+
assert_raise(ArgumentError) { ShortURL.shorten(@url, :foobar) }
end
def test_get_short_url
post_string = "post('/create.php', 'url=#@url')"
@@ -54,7 +61,19 @@
assert_raise(NoMethodError) { ShortURL.rubyurl(@url) }
end
def test_tinyurl
assert_raise(NoMethodError) { ShortURL.tinyurl(@url) }
+ end
+
+ def test_shorl
+ assert_raise(NoMethodError) { ShortURL.shorl(@url) }
+ end
+
+ def test_snipurl
+ assert_raise(NoMethodError) { ShortURL.snipurl(@url) }
+ end
+
+ def test_metamark
+ assert_raise(NoMethodError) { ShortURL.metamark(@url) }
end
end