Sha256: 99efd84138b28daa457efe9473dd31a3bbbe33f618fbf373772f5884b2cbbd5b

Contents?: true

Size: 735 Bytes

Versions: 6

Compression:

Stored size: 735 Bytes

Contents

RSpec.configure do |config|
  raise "Could not find arangod. Please install it or check if it is in your path." if `which arangod` == ""

  database_directory = "/tmp/ashikawa-integration"
  arango_process = false

  config.before(:suite) do
    puts "Starting ArangoDB"
    process_id = $$

    Dir.mkdir database_directory unless Dir.exists? database_directory
    arango_process = IO.popen("arangod #{database_directory} --watch-process #{process_id}")

    sleep 2 # Wait for Arango to start up
  end

  config.after(:suite) do
    puts
    puts "Shutting down ArangoDB"

    Process.kill "INT", arango_process.pid
    sleep 2  # Wait for Arango to shut down
    arango_process.close

    `rm -r #{database_directory}/*`
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ashikawa-ar-0.1.3 spec/integration/arango_helper.rb
ashikawa-core-0.4.1 spec/integration/arango_helper.rb
ashikawa-ar-0.1.2 spec/integration/arango_helper.rb
ashikawa-core-0.3.0 spec/integration/arango_helper.rb
ashikawa-core-0.2.1 spec/integration/arango_helper.rb
ashikawa-core-0.2 spec/integration/arango_helper.rb