1 require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
2 require 'rubygems/commands/stale_command'
4 class TestGemCommandsStaleCommand < RubyGemTestCase
8 @cmd = Gem::Commands::StaleCommand.new
11 def test_execute_sorts
12 files = %w[lib/foo_bar.rb Rakefile]
13 foo_bar = quick_gem 'foo_bar' do |gem|
16 bar_baz = quick_gem 'bar_baz' do |gem|
21 filename = bar_baz.full_gem_path + "/#{file}"
22 FileUtils.mkdir_p(File.dirname(filename))
23 FileUtils.touch(filename, :mtime => Time.now)
25 filename = foo_bar.full_gem_path + "/#{file}"
26 FileUtils.mkdir_p(File.dirname(filename))
27 FileUtils.touch(filename, :mtime => Time.now - 86400)
33 lines = @ui.output.split("\n")
34 assert_equal("#{foo_bar.name}-#{foo_bar.version}", lines[0].split.first)
35 assert_equal("#{bar_baz.name}-#{bar_baz.version}", lines[1].split.first)