Sha256: 063221c9706737f02fa8440989bd7fcd4a4d764e26c5851f1c572ddcbd418e93

Contents?: true

Size: 1.38 KB

Versions: 7

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'
require 'riak/test_server'

describe Riak::TestServer do
  subject { $test_server }
  let(:app_config) { (subject.etc + 'app.config').read }

  it "should add the test backends to the code path" do
    erl_src = File.expand_path("../../../../erl_src", __FILE__)
    subject.env[:riak_kv][:add_paths].should include(erl_src)
    app_config.should match(/\{add_paths, \[.*#{erl_src.inspect}.*\]\}/)
  end

  it "should use the KV test backend" do
    backend = subject.version < "1.0.0" ? :riak_kv_test014_backend : :riak_kv_test_backend
    subject.kv_backend.should == backend
    subject.env[:riak_kv][:storage_backend].should == backend
    app_config.should include("{storage_backend, #{backend}}")
  end

  it "should use the Search test backend" do
    subject.search_backend.should == :riak_search_test_backend
    subject.env[:riak_search][:search_backend].should == :riak_search_test_backend
    app_config.should include("{search_backend, riak_search_test_backend}")
  end

  it "should clear stored data" do
    # TODO: use $test_server.to_host when client/host split is finished.
    client = Riak::Client.new(:http_port => subject.http_port)
    obj = client['test_bucket'].new("test_item")
    obj.data = {"data" => "testing"}
    obj.store # rescue nil

    subject.drop
    expect {
      client['test_bucket']['test_item']
    }.to raise_error(Riak::FailedRequest)
  end
end

Version data entries

7 entries across 3 versions & 1 rubygems

Version Path
riak-client-1.0.3 pkg/riak-client-1.0.0/spec/integration/riak/test_server_spec.rb
riak-client-1.0.3 pkg/riak-client-1.0.1/pkg/riak-client-1.0.0/spec/integration/riak/test_server_spec.rb
riak-client-1.0.3 pkg/riak-client-1.0.2/pkg/riak-client-1.0.0/spec/integration/riak/test_server_spec.rb
riak-client-1.0.3 pkg/riak-client-1.0.2/pkg/riak-client-1.0.1/pkg/riak-client-1.0.0/spec/integration/riak/test_server_spec.rb
riak-client-1.0.2 pkg/riak-client-1.0.0/spec/integration/riak/test_server_spec.rb
riak-client-1.0.2 pkg/riak-client-1.0.1/pkg/riak-client-1.0.0/spec/integration/riak/test_server_spec.rb
riak-client-1.0.0 spec/integration/riak/test_server_spec.rb