From 40c0bc4e3c63aa398d319ec08846538705950e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20A=C3=9Fmann?= Date: Thu, 23 Jul 2009 07:34:49 +0800 Subject: [PATCH] Expect strings as arguments and to_i the revision. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Beausoleil --- lib/piston/svn/revision.rb | 2 +- test/unit/svn/revision/test_checkout.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/piston/svn/revision.rb b/lib/piston/svn/revision.rb index 5bf1038..0a519a0 100644 --- a/lib/piston/svn/revision.rb +++ b/lib/piston/svn/revision.rb @@ -26,7 +26,7 @@ def checkout_to(dir) if answer =~ /Checked out revision (\d+)[.]/ then if revision == "HEAD" then @revision = $1.to_i - elsif revision != $1.to_i then + elsif revision.to_i != $1.to_i then raise InvalidRevision, "Did not get the revision I wanted to checkout. Subversion checked out #{$1}, I wanted #{revision}" end else diff --git a/test/unit/svn/revision/test_checkout.rb b/test/unit/svn/revision/test_checkout.rb index 86322ff..c77cd30 100644 --- a/test/unit/svn/revision/test_checkout.rb +++ b/test/unit/svn/revision/test_checkout.rb @@ -16,8 +16,8 @@ def test_head_checkout_to_path end def test_specific_revision_checkout_to_path - rev = new_revision(1231) - rev.expects(:svn).with(:checkout, "--revision", 1231, @repos.url, @wcdir).returns("Checked out revision 1231.") + rev = new_revision('1231') + rev.expects(:svn).with(:checkout, "--revision", '1231', @repos.url, @wcdir).returns("Checked out revision 1231.") rev.checkout_to(@wcdir) end