Sha256: 6e15fe1972e370c8dfb10aea540758e32b572232f0cf256465ebfc67c1082a0e

Contents?: true

Size: 1.89 KB

Versions: 2

Compression:

Stored size: 1.89 KB

Contents

require 'spec_helper'
require 'riak/client/feature_detection'

describe Riak::Client::FeatureDetection do
  let(:klass) {
    Class.new do
      include Riak::Client::FeatureDetection
    end
  }
  subject { klass.new }

  context "when the get_server_version is unimplemented" do
    it "should raise a NotImplementedError" do
      expect { subject.server_version }.to raise_error(NotImplementedError)
    end
  end

  context "when the Riak version is 0.14.x" do
    before { subject.stub!(:get_server_version).and_return("0.14.2") }
    it { should_not be_mapred_phaseless }
    it { should_not be_pb_indexes }
    it { should_not be_pb_search }
    it { should_not be_pb_conditionals }
    it { should_not be_quorum_controls }
    it { should_not be_tombstone_vclocks }
    it { should_not be_pb_head }
  end

  context "when the Riak version is 1.0.x" do
    before { subject.stub!(:get_server_version).and_return("1.0.3") }
    it { should_not be_mapred_phaseless }
    it { should_not be_pb_indexes }
    it { should_not be_pb_search }
    it { should be_pb_conditionals }
    it { should be_quorum_controls }
    it { should be_tombstone_vclocks }
    it { should be_pb_head }
  end

  context "when the Riak version is 1.1.x" do
    before { subject.stub!(:get_server_version).and_return("1.1.4") }
    it { should be_mapred_phaseless }
    it { should_not be_pb_indexes }
    it { should_not be_pb_search }
    it { should be_pb_conditionals }
    it { should be_quorum_controls }
    it { should be_tombstone_vclocks }
    it { should be_pb_head }
  end

  context "when the Riak version is 1.2.x" do
    before { subject.stub!(:get_server_version).and_return("1.2.0") }
    it { should be_mapred_phaseless }
    it { should be_pb_indexes }
    it { should be_pb_search }
    it { should be_pb_conditionals }
    it { should be_quorum_controls }
    it { should be_tombstone_vclocks }
    it { should be_pb_head }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
riak-client-1.1.1 spec/riak/feature_detection_spec.rb
riak-client-1.1.0 spec/riak/feature_detection_spec.rb