test/test_file_index.rb in mercurial-ruby-0.5.0 vs test/test_file_index.rb in mercurial-ruby-0.6.0

- old
+ new

@@ -92,9 +92,19 @@ @file_index.reload @file_index.count_all.must_equal 26 @file_index.instance_variable_get('@commit_index').keys.sort.must_equal(['bf6386c0a0ccd1282dbbe51888f52fe82b1806e3', 'bc729b15e2b556065dd4f32c161f54be5dd92776', '63f70b2314ede1e12813cae87f6f303ee8d5c09a', '6157254a442343181939c7af1a744cf2a16afcce', 'a07263ded0729d146062e6ec076cf1e6af214218', '3cdad3d3ca0054ebfcd2652cc83442bd0d272bbb', '25bb5c51fd613b8b58d88ef1caf99da559af51f3', '63e18640e83af60196334f16cc31f4f99c419918', '8fc3d59965d71a9b83308c53a76f3af0235b6eb6', '0f41dd2ec1667518741da599db7264943c9ed472', '16fac694db0a52edfd266576acafb475f7f8420f', '34f85a44acf11c3386f771a65445d6c39e5261d6', '4474d1ddaf653cb7fbf18bb62ff1e39a4e571969', 'cd9fa0c59c7f189fa1d70edea564e534ac9478d0', '611407bf9b369e061eaf0bee1a261c9e62ad713d', 'd14b0c16b21d9d3e08101ef264959a7d91a8b5db', '3e1ea66bdd04dbfb8d91e4f2de3baca218cd4cca', 'bbfe40f4a56961bdfc6b497a19cc35e18f2d40a3', '4e9f11e95eade74c55fc785e3159015f8a472f4b', '11998206a49ca9a55b4065508ce6ca10945e3e73', '1b99d0243f8e5542c1b33a013b63130f9009ac52', '612af4851a6c483f499cadf1dd28040d7996aa78', '54d96f4b1a260dc5614e89c1ed8c2d2edaa4942f', '207476112e024921b1538a096e5f6812d0698cab', 'ea1e37a728e989176e9e7b33f0d0e035fd347623', 'a8b39838302fc5aad12bb6b043331b9ef50149ed'].sort) end + it "should raise error if file_index not found" do + @file_index.stubs(:path).returns('/tmp/blablabla') + lambda{ @file_index.send(:read_index) }.must_raise Mercurial::FileIndex::IndexFileNotFound + end + + it "should raise error if file_index is too big" do + Mercurial::FileIndex.stubs(:max_file_size).returns(1) + lambda{ @file_index.send(:read_index) }.must_raise Mercurial::FileIndex::IndexFileTooBig + end + private # contains two oldest commits only def preset_sample_index %q[bf6386c0a0ccd1282dbbe51888f52fe82b1806e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 Initial files. \ No newline at end of file