2016-02-01 07:43:26 -05:00
|
|
|
# frozen_string_literal: true
|
2021-06-01 23:32:47 -04:00
|
|
|
require_relative "helper"
|
2007-11-10 02:48:56 -05:00
|
|
|
require "rubygems/indexer"
|
|
|
|
|
2011-01-28 18:46:47 -05:00
|
|
|
class TestGemIndexer < Gem::TestCase
|
2007-11-10 02:48:56 -05:00
|
|
|
def setup
|
|
|
|
super
|
|
|
|
|
|
|
|
util_make_gems
|
|
|
|
|
2013-11-11 19:16:41 -05:00
|
|
|
@d2_0 = util_spec "d", "2.0" do |s|
|
2009-06-09 17:38:59 -04:00
|
|
|
s.date = Gem::Specification::TODAY - 86400 * 3
|
|
|
|
end
|
2008-06-17 18:04:18 -04:00
|
|
|
util_build_gem @d2_0
|
|
|
|
|
2013-11-11 19:16:41 -05:00
|
|
|
@d2_0_a = util_spec "d", "2.0.a"
|
2009-06-09 17:38:59 -04:00
|
|
|
util_build_gem @d2_0_a
|
|
|
|
|
2013-11-11 19:16:41 -05:00
|
|
|
@d2_0_b = util_spec "d", "2.0.b"
|
2009-06-09 17:38:59 -04:00
|
|
|
util_build_gem @d2_0_b
|
|
|
|
|
2013-10-15 20:14:16 -04:00
|
|
|
@default = new_default_spec "default", 2
|
|
|
|
install_default_gems @default
|
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
@indexerdir = File.join(@tempdir, "indexer")
|
2011-03-09 17:32:29 -05:00
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
gems = File.join(@indexerdir, "gems")
|
2007-11-10 02:48:56 -05:00
|
|
|
FileUtils.mkdir_p gems
|
2011-05-31 23:45:05 -04:00
|
|
|
FileUtils.mv Dir[File.join(@gemhome, "cache", "*.gem")], gems
|
2007-11-10 02:48:56 -05:00
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
@indexer = Gem::Indexer.new(@indexerdir)
|
2019-02-14 07:59:03 -05:00
|
|
|
end
|
|
|
|
|
2007-11-10 02:48:56 -05:00
|
|
|
def test_initialize
|
2019-06-01 05:45:11 -04:00
|
|
|
assert_equal @indexerdir, @indexer.dest_directory
|
2018-02-05 21:58:35 -05:00
|
|
|
assert_match %r{#{Dir.mktmpdir('gem_generate_index').match(/.*-/)}}, @indexer.directory
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
indexer = Gem::Indexer.new @indexerdir
|
2009-06-09 17:38:59 -04:00
|
|
|
assert indexer.build_modern
|
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
indexer = Gem::Indexer.new @indexerdir, :build_modern => true
|
2009-06-09 17:38:59 -04:00
|
|
|
assert indexer.build_modern
|
2007-11-10 02:48:56 -05:00
|
|
|
end
|
|
|
|
|
2015-05-09 23:01:18 -04:00
|
|
|
def test_build_indices
|
2008-06-25 22:06:00 -04:00
|
|
|
@indexer.make_temp_directories
|
|
|
|
|
|
|
|
use_ui @ui do
|
2015-05-09 23:01:18 -04:00
|
|
|
@indexer.build_indices
|
2008-06-25 22:06:00 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
specs_path = File.join @indexer.directory, "specs.#{@marshal_version}"
|
|
|
|
specs_dump = Gem.read_binary specs_path
|
|
|
|
specs = Marshal.load specs_dump
|
|
|
|
|
2011-05-31 23:45:05 -04:00
|
|
|
expected = [["a", Gem::Version.new("1"), "ruby"],
|
|
|
|
["a", Gem::Version.new("2"), "ruby"],
|
|
|
|
["a_evil", Gem::Version.new("9"), "ruby"],
|
|
|
|
["b", Gem::Version.new("2"), "ruby"],
|
|
|
|
["c", Gem::Version.new("1.2"), "ruby"],
|
|
|
|
["d", Gem::Version.new("2.0"), "ruby"],
|
2012-11-29 01:52:18 -05:00
|
|
|
["dep_x", Gem::Version.new("1"), "ruby"],
|
|
|
|
["pl", Gem::Version.new("1"), "i386-linux"],
|
|
|
|
["x", Gem::Version.new("1"), "ruby"]]
|
2008-06-25 22:06:00 -04:00
|
|
|
|
2011-05-31 23:45:05 -04:00
|
|
|
assert_equal expected, specs
|
2008-06-25 22:06:00 -04:00
|
|
|
|
2011-05-31 23:45:05 -04:00
|
|
|
latest_specs_path = File.join(@indexer.directory,
|
|
|
|
"latest_specs.#{@marshal_version}")
|
2008-06-25 22:06:00 -04:00
|
|
|
latest_specs_dump = Gem.read_binary latest_specs_path
|
|
|
|
latest_specs = Marshal.load latest_specs_dump
|
|
|
|
|
2011-05-31 23:45:05 -04:00
|
|
|
expected = [["a", Gem::Version.new("2"), "ruby"],
|
|
|
|
["a_evil", Gem::Version.new("9"), "ruby"],
|
|
|
|
["b", Gem::Version.new("2"), "ruby"],
|
|
|
|
["c", Gem::Version.new("1.2"), "ruby"],
|
|
|
|
["d", Gem::Version.new("2.0"), "ruby"],
|
2012-11-29 01:52:18 -05:00
|
|
|
["dep_x", Gem::Version.new("1"), "ruby"],
|
|
|
|
["pl", Gem::Version.new("1"), "i386-linux"],
|
|
|
|
["x", Gem::Version.new("1"), "ruby"]]
|
2008-06-25 22:06:00 -04:00
|
|
|
|
|
|
|
assert_equal expected, latest_specs, "latest_specs"
|
|
|
|
end
|
|
|
|
|
2007-11-10 02:48:56 -05:00
|
|
|
def test_generate_index
|
|
|
|
use_ui @ui do
|
|
|
|
@indexer.generate_index
|
|
|
|
end
|
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
quickdir = File.join @indexerdir, "quick"
|
2007-11-10 02:48:56 -05:00
|
|
|
marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
|
|
|
|
|
2019-03-04 22:32:58 -05:00
|
|
|
assert_directory_exists quickdir
|
|
|
|
assert_directory_exists marshal_quickdir
|
2007-11-20 00:56:43 -05:00
|
|
|
|
2011-05-31 23:45:05 -04:00
|
|
|
assert_indexed marshal_quickdir, "#{File.basename(@a1.spec_file)}.rz"
|
|
|
|
assert_indexed marshal_quickdir, "#{File.basename(@a2.spec_file)}.rz"
|
2007-11-20 00:56:43 -05:00
|
|
|
|
2011-05-31 23:45:05 -04:00
|
|
|
refute_indexed marshal_quickdir, File.basename(@c1_2.spec_file)
|
2008-06-17 18:04:18 -04:00
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
assert_indexed @indexerdir, "specs.#{@marshal_version}"
|
|
|
|
assert_indexed @indexerdir, "specs.#{@marshal_version}.gz"
|
2008-06-17 18:04:18 -04:00
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
assert_indexed @indexerdir, "latest_specs.#{@marshal_version}"
|
|
|
|
assert_indexed @indexerdir, "latest_specs.#{@marshal_version}.gz"
|
2022-06-24 03:21:47 -04:00
|
|
|
|
|
|
|
refute_directory_exists @indexer.directory
|
2009-06-09 17:38:59 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_generate_index_modern
|
|
|
|
@indexer.build_modern = true
|
|
|
|
|
|
|
|
use_ui @ui do
|
|
|
|
@indexer.generate_index
|
|
|
|
end
|
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
refute_indexed @indexerdir, "yaml"
|
|
|
|
refute_indexed @indexerdir, "yaml.Z"
|
|
|
|
refute_indexed @indexerdir, "Marshal.#{@marshal_version}"
|
|
|
|
refute_indexed @indexerdir, "Marshal.#{@marshal_version}.Z"
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
quickdir = File.join @indexerdir, "quick"
|
2009-06-09 17:38:59 -04:00
|
|
|
marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
|
|
|
|
|
2019-03-04 22:32:58 -05:00
|
|
|
assert_directory_exists quickdir, "quickdir should be directory"
|
|
|
|
assert_directory_exists marshal_quickdir
|
2009-06-09 17:38:59 -04:00
|
|
|
|
|
|
|
refute_indexed quickdir, "index"
|
|
|
|
refute_indexed quickdir, "index.rz"
|
|
|
|
|
|
|
|
refute_indexed quickdir, "latest_index"
|
|
|
|
refute_indexed quickdir, "latest_index.rz"
|
|
|
|
|
2011-05-31 23:45:05 -04:00
|
|
|
refute_indexed quickdir, "#{File.basename(@a1.spec_file)}.rz"
|
|
|
|
refute_indexed quickdir, "#{File.basename(@a2.spec_file)}.rz"
|
|
|
|
refute_indexed quickdir, "#{File.basename(@b2.spec_file)}.rz"
|
|
|
|
refute_indexed quickdir, "#{File.basename(@c1_2.spec_file)}.rz"
|
2009-06-09 17:38:59 -04:00
|
|
|
|
|
|
|
refute_indexed quickdir, "#{@pl1.original_name}.gemspec.rz"
|
2011-05-31 23:45:05 -04:00
|
|
|
refute_indexed quickdir, "#{File.basename(@pl1.spec_file)}.rz"
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2011-05-31 23:45:05 -04:00
|
|
|
assert_indexed marshal_quickdir, "#{File.basename(@a1.spec_file)}.rz"
|
|
|
|
assert_indexed marshal_quickdir, "#{File.basename(@a2.spec_file)}.rz"
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2011-05-31 23:45:05 -04:00
|
|
|
refute_indexed quickdir, "#{File.basename(@c1_2.spec_file)}"
|
|
|
|
refute_indexed marshal_quickdir, "#{File.basename(@c1_2.spec_file)}"
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
assert_indexed @indexerdir, "specs.#{@marshal_version}"
|
|
|
|
assert_indexed @indexerdir, "specs.#{@marshal_version}.gz"
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
assert_indexed @indexerdir, "latest_specs.#{@marshal_version}"
|
|
|
|
assert_indexed @indexerdir, "latest_specs.#{@marshal_version}.gz"
|
2009-06-09 17:38:59 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_generate_index_modern_back_to_back
|
|
|
|
@indexer.build_modern = true
|
|
|
|
|
|
|
|
use_ui @ui do
|
|
|
|
@indexer.generate_index
|
|
|
|
end
|
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
@indexer = Gem::Indexer.new @indexerdir
|
2009-06-09 17:38:59 -04:00
|
|
|
@indexer.build_modern = true
|
|
|
|
|
|
|
|
use_ui @ui do
|
|
|
|
@indexer.generate_index
|
|
|
|
end
|
2019-06-01 05:45:11 -04:00
|
|
|
quickdir = File.join @indexerdir, "quick"
|
2009-06-09 17:38:59 -04:00
|
|
|
marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
|
|
|
|
|
2019-03-04 22:32:58 -05:00
|
|
|
assert_directory_exists quickdir
|
|
|
|
assert_directory_exists marshal_quickdir
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2011-05-31 23:45:05 -04:00
|
|
|
assert_indexed marshal_quickdir, "#{File.basename(@a1.spec_file)}.rz"
|
|
|
|
assert_indexed marshal_quickdir, "#{File.basename(@a2.spec_file)}.rz"
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
assert_indexed @indexerdir, "specs.#{@marshal_version}"
|
|
|
|
assert_indexed @indexerdir, "specs.#{@marshal_version}.gz"
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
assert_indexed @indexerdir, "latest_specs.#{@marshal_version}"
|
|
|
|
assert_indexed @indexerdir, "latest_specs.#{@marshal_version}.gz"
|
2007-11-10 02:48:56 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_generate_index_ui
|
|
|
|
use_ui @ui do
|
|
|
|
@indexer.generate_index
|
|
|
|
end
|
|
|
|
|
2020-03-24 14:51:43 -04:00
|
|
|
assert_match %r{^\.\.\.\.\.\.\.\.\.\.\.\.$}, @ui.output
|
|
|
|
assert_match %r{^Generating Marshal quick index gemspecs for 12 gems$},
|
2009-06-09 17:38:59 -04:00
|
|
|
@ui.output
|
2020-03-24 14:51:43 -04:00
|
|
|
assert_match %r{^Complete$}, @ui.output
|
|
|
|
assert_match %r{^Generating specs index$}, @ui.output
|
|
|
|
assert_match %r{^Generating latest specs index$}, @ui.output
|
|
|
|
assert_match %r{^Generating prerelease specs index$}, @ui.output
|
|
|
|
assert_match %r{^Complete$}, @ui.output
|
|
|
|
assert_match %r{^Compressing indices$}, @ui.output
|
2007-11-10 02:48:56 -05:00
|
|
|
|
|
|
|
assert_equal "", @ui.error
|
|
|
|
end
|
|
|
|
|
2008-06-17 18:04:18 -04:00
|
|
|
def test_generate_index_specs
|
|
|
|
use_ui @ui do
|
|
|
|
@indexer.generate_index
|
|
|
|
end
|
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
specs_path = File.join @indexerdir, "specs.#{@marshal_version}"
|
2008-06-17 18:04:18 -04:00
|
|
|
|
|
|
|
specs_dump = Gem.read_binary specs_path
|
|
|
|
specs = Marshal.load specs_dump
|
|
|
|
|
|
|
|
expected = [
|
|
|
|
["a", Gem::Version.new(1), "ruby"],
|
|
|
|
["a", Gem::Version.new(2), "ruby"],
|
|
|
|
["a_evil", Gem::Version.new(9), "ruby"],
|
|
|
|
["b", Gem::Version.new(2), "ruby"],
|
|
|
|
["c", Gem::Version.new("1.2"), "ruby"],
|
|
|
|
["d", Gem::Version.new("2.0"), "ruby"],
|
2012-11-29 01:52:18 -05:00
|
|
|
["dep_x", Gem::Version.new(1), "ruby"],
|
2008-06-17 18:04:18 -04:00
|
|
|
["pl", Gem::Version.new(1), "i386-linux"],
|
2012-11-29 01:52:18 -05:00
|
|
|
["x", Gem::Version.new(1), "ruby"],
|
2008-06-17 18:04:18 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
assert_equal expected, specs
|
|
|
|
|
|
|
|
assert_same specs[0].first, specs[1].first,
|
|
|
|
"identical names not identical"
|
|
|
|
|
|
|
|
assert_same specs[0][1], specs[-1][1],
|
|
|
|
"identical versions not identical"
|
|
|
|
|
|
|
|
assert_same specs[0].last, specs[1].last,
|
|
|
|
"identical platforms not identical"
|
|
|
|
|
2008-10-25 18:58:43 -04:00
|
|
|
refute_same specs[1][1], specs[5][1],
|
|
|
|
"different versions not different"
|
2008-06-17 18:04:18 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_generate_index_latest_specs
|
|
|
|
use_ui @ui do
|
|
|
|
@indexer.generate_index
|
|
|
|
end
|
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
latest_specs_path = File.join @indexerdir, "latest_specs.#{@marshal_version}"
|
2008-06-17 18:04:18 -04:00
|
|
|
|
|
|
|
latest_specs_dump = Gem.read_binary latest_specs_path
|
|
|
|
latest_specs = Marshal.load latest_specs_dump
|
|
|
|
|
|
|
|
expected = [
|
|
|
|
["a", Gem::Version.new(2), "ruby"],
|
|
|
|
["a_evil", Gem::Version.new(9), "ruby"],
|
|
|
|
["b", Gem::Version.new(2), "ruby"],
|
|
|
|
["c", Gem::Version.new("1.2"), "ruby"],
|
|
|
|
["d", Gem::Version.new("2.0"), "ruby"],
|
2012-11-29 01:52:18 -05:00
|
|
|
["dep_x", Gem::Version.new(1), "ruby"],
|
2008-06-17 18:04:18 -04:00
|
|
|
["pl", Gem::Version.new(1), "i386-linux"],
|
2012-11-29 01:52:18 -05:00
|
|
|
["x", Gem::Version.new(1), "ruby"],
|
2008-06-17 18:04:18 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
assert_equal expected, latest_specs
|
|
|
|
|
|
|
|
assert_same latest_specs[0][1], latest_specs[2][1],
|
|
|
|
"identical versions not identical"
|
|
|
|
|
|
|
|
assert_same latest_specs[0].last, latest_specs[1].last,
|
|
|
|
"identical platforms not identical"
|
|
|
|
end
|
|
|
|
|
2009-06-09 17:38:59 -04:00
|
|
|
def test_generate_index_prerelease_specs
|
|
|
|
use_ui @ui do
|
|
|
|
@indexer.generate_index
|
|
|
|
end
|
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
prerelease_specs_path = File.join @indexerdir, "prerelease_specs.#{@marshal_version}"
|
2009-06-09 17:38:59 -04:00
|
|
|
|
|
|
|
prerelease_specs_dump = Gem.read_binary prerelease_specs_path
|
|
|
|
prerelease_specs = Marshal.load prerelease_specs_dump
|
|
|
|
|
|
|
|
assert_equal [["a", Gem::Version.new("3.a"), "ruby"],
|
|
|
|
["d", Gem::Version.new("2.0.a"), "ruby"],
|
|
|
|
["d", Gem::Version.new("2.0.b"), "ruby"]],
|
|
|
|
prerelease_specs
|
|
|
|
end
|
|
|
|
|
2012-11-29 01:52:18 -05:00
|
|
|
##
|
|
|
|
# Emulate the starting state of Gem::Specification in a live environment,
|
|
|
|
# where it will carry the list of system gems
|
|
|
|
def with_system_gems
|
|
|
|
Gem::Specification.reset
|
|
|
|
|
2013-11-11 19:16:41 -05:00
|
|
|
sys_gem = util_spec "systemgem", "1.0"
|
2012-11-29 01:52:18 -05:00
|
|
|
util_build_gem sys_gem
|
2015-07-01 17:50:14 -04:00
|
|
|
install_default_gems sys_gem
|
2012-11-29 01:52:18 -05:00
|
|
|
yield
|
|
|
|
util_remove_gem sys_gem
|
|
|
|
end
|
|
|
|
|
2009-06-09 17:38:59 -04:00
|
|
|
def test_update_index
|
|
|
|
use_ui @ui do
|
|
|
|
@indexer.generate_index
|
|
|
|
end
|
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
quickdir = File.join @indexerdir, "quick"
|
2009-06-09 17:38:59 -04:00
|
|
|
marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
|
|
|
|
|
2019-03-04 22:32:58 -05:00
|
|
|
assert_directory_exists quickdir
|
|
|
|
assert_directory_exists marshal_quickdir
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2013-11-11 19:16:41 -05:00
|
|
|
@d2_1 = util_spec "d", "2.1"
|
2009-06-09 17:38:59 -04:00
|
|
|
util_build_gem @d2_1
|
|
|
|
@d2_1_tuple = [@d2_1.name, @d2_1.version, @d2_1.original_platform]
|
|
|
|
|
2013-11-11 19:16:41 -05:00
|
|
|
@d2_1_a = util_spec "d", "2.2.a"
|
2009-06-09 17:38:59 -04:00
|
|
|
util_build_gem @d2_1_a
|
|
|
|
@d2_1_a_tuple = [@d2_1_a.name, @d2_1_a.version, @d2_1_a.original_platform]
|
|
|
|
|
2019-06-01 05:45:11 -04:00
|
|
|
gems = File.join @indexerdir, "gems"
|
2011-05-31 23:45:05 -04:00
|
|
|
|
|
|
|
FileUtils.mv @d2_1.cache_file, gems
|
|
|
|
FileUtils.mv @d2_1_a.cache_file, gems
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2012-11-29 01:52:18 -05:00
|
|
|
with_system_gems do
|
|
|
|
use_ui @ui do
|
|
|
|
@indexer.update_index
|
|
|
|
end
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2012-11-29 01:52:18 -05:00
|
|
|
assert_indexed marshal_quickdir, "#{File.basename(@d2_1.spec_file)}.rz"
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2012-11-29 01:52:18 -05:00
|
|
|
specs_index = Marshal.load Gem.read_binary(@indexer.dest_specs_index)
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2012-11-29 01:52:18 -05:00
|
|
|
assert_includes specs_index, @d2_1_tuple
|
|
|
|
refute_includes specs_index, @d2_1_a_tuple
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2012-11-29 01:52:18 -05:00
|
|
|
latest_specs_index = Marshal.load \
|
|
|
|
Gem.read_binary(@indexer.dest_latest_specs_index)
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2012-11-29 01:52:18 -05:00
|
|
|
assert_includes latest_specs_index, @d2_1_tuple
|
|
|
|
assert_includes latest_specs_index,
|
|
|
|
[@d2_0.name, @d2_0.version, @d2_0.original_platform]
|
|
|
|
refute_includes latest_specs_index, @d2_1_a_tuple
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2012-11-29 01:52:18 -05:00
|
|
|
pre_specs_index = Marshal.load \
|
|
|
|
Gem.read_binary(@indexer.dest_prerelease_specs_index)
|
2009-06-09 17:38:59 -04:00
|
|
|
|
2012-11-29 01:52:18 -05:00
|
|
|
assert_includes pre_specs_index, @d2_1_a_tuple
|
|
|
|
refute_includes pre_specs_index, @d2_1_tuple
|
2022-06-24 03:21:47 -04:00
|
|
|
|
|
|
|
refute_directory_exists @indexer.directory
|
2012-11-29 01:52:18 -05:00
|
|
|
end
|
2009-06-09 17:38:59 -04:00
|
|
|
end
|
|
|
|
|
2007-11-20 00:56:43 -05:00
|
|
|
def assert_indexed(dir, name)
|
|
|
|
file = File.join dir, name
|
|
|
|
assert File.exist?(file), "#{file} does not exist"
|
|
|
|
end
|
|
|
|
|
2008-06-17 18:04:18 -04:00
|
|
|
def refute_indexed(dir, name)
|
2007-11-20 00:56:43 -05:00
|
|
|
file = File.join dir, name
|
2009-06-09 17:38:59 -04:00
|
|
|
refute File.exist?(file), "#{file} exists"
|
2007-11-20 00:56:43 -05:00
|
|
|
end
|
2020-04-25 08:09:24 -04:00
|
|
|
end
|