aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2010-07-06 11:49:43 -0700
committerAdam Vandenberg2010-07-06 13:17:43 -0700
commitfe2014feb7023ac4e684d7f3a43f6abbfc033738 (patch)
tree6cab081eb0001c0b57140ec86626fd1b78ddc613
parent99200036573d4a288dbdbb2ef2d80cbc269169d3 (diff)
downloadhomebrew-fe2014feb7023ac4e684d7f3a43f6abbfc033738.tar.bz2
Update version tests
-rw-r--r--Library/Homebrew/test/test_versions.rb39
1 files changed, 22 insertions, 17 deletions
diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb
index a02bdb49e..2930276ef 100644
--- a/Library/Homebrew/test/test_versions.rb
+++ b/Library/Homebrew/test/test_versions.rb
@@ -25,21 +25,21 @@ class VersionTests < Test::Unit::TestCase
d.mkpath
assert_equal '0.1.9', d.version
end
-
+
def test_no_version
assert_nil Pathname.new("http://example.com/blah.tar").version
assert_nil Pathname.new("arse").version
end
-
+
def test_bad_version
assert_raises(RuntimeError) {f=TestBadVersion.new}
end
-
+
def check pathname, version
r=MockFormula.new pathname
assert_equal version, r.version
end
-
+
def test_version_all_dots
check "http://example.com/foo.bar.la.1.14.zip", '1.14'
end
@@ -55,26 +55,21 @@ class VersionTests < Test::Unit::TestCase
def test_erlang_version_style
check "http://erlang.org/download/otp_src_R13B.tar.gz", 'R13B'
end
-
+
def test_p7zip_version_style
check "http://kent.dl.sourceforge.net/sourceforge/p7zip/p7zip_9.04_src_all.tar.bz2",
'9.04'
end
-
+
def test_gloox_beta_style
check "http://camaya.net/download/gloox-1.0-beta7.tar.bz2", '1.0-beta7'
end
-
+
def test_astyle_verson_style
check "http://kent.dl.sourceforge.net/sourceforge/astyle/astyle_1.23_macosx.tar.gz",
'1.23'
end
-
- def test_version_libvorbis
- check "http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.2rc1.tar.bz2",
- '1.2.2rc1'
- end
-
+
def test_version_dos2unix
check "http://www.sfr-fresh.com/linux/misc/dos2unix-3.1.tar.gz", '3.1'
end
@@ -115,24 +110,34 @@ class VersionTests < Test::Unit::TestCase
check 'http://kent.dl.sourceforge.net/sourceforge/lame/lame-398-2.tar.gz',
'398-2'
end
-
+
def test_ruby_version_style
check 'ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p243.tar.gz',
'1.9.1-p243'
end
-
+
def test_omega_version_style
check 'http://www.alcyone.com/binaries/omega/omega-0.80.2-src.tar.gz',
'0.80.2'
end
- def test_version_style_rc
+ def test_rc_style
+ check "http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.2rc1.tar.bz2",
+ '1.2.2rc1'
+ end
+
+ def test_dash_rc_style
check 'http://ftp.mozilla.org/pub/mozilla.org/js/js-1.8.0-rc1.tar.gz',
'1.8.0-rc1'
end
-
+
def test_angband_version_style
check 'http://rephial.org/downloads/3.0/angband-3.0.9b-src.tar.gz',
'3.0.9b'
end
+
+ def test_stable_suffix
+ check 'http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz',
+ '1.4.14b'
+ end
end