[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PATCH for gem2deb: gem2tgz will pick the newest gemfile instead of the first one



On 02/27/2012 11:52 PM, Cédric Boutillier wrote:
On Mon, Feb 27, 2012 at 05:18:34PM +0100, Matijs van Zuijlen wrote:

I would definitely check the actual version of the gem rather than
the mtime. There are all kinds of reasons an earlier version might
have a later mtime accidentally.

Thanks for your feedback. Here is thus a second attempt, with the use of
Gem::Version.

Looks good, thanks.

Going into full paranoid mode, what if locally we already have a later version that got pulled from rubygems.org? Maybe I'm overthinking this, though.

I thought about writing a test for that, but this part is used
only when a gem is fetched. If we don't want to assume that we have a
network connection during the tests, I imagine that we need to create a
local gem repository, with two versions of the same simple gem, and
fetch from there.

If you really want to add tests, you could use some mocking instead. It looks like you only need to mock the call to run.

--
Matijs


Reply to: