aboutsummaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 005ae8174..72457815a 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -38,10 +38,18 @@ def load_file_fixture(file_name)
end
def rebuild_xapian_index
+ # XXX could for speed call ActsAsXapian.rebuild_index directly, but would
+ # need model name list, and would need to fix acts_as_xapian so can call writes
+ # and reads mixed up (it asserts where it thinks it can't do this)
rebuild_name = File.dirname(__FILE__) + '/../script/rebuild-xapian-index'
Kernel.system(rebuild_name) or raise "failed to launch #{rebuild_name}, error bitcode #{$?}, exit status: #{$?.exitstatus}"
end
+def update_xapian_index
+ verbose = false
+ ActsAsXapian.update_index(flush_to_disk=true, verbose)
+end
+
# Validate an entire HTML page
def validate_html(html)
$tempfilecount = $tempfilecount + 1