Sha256: e2b2d85b0ec67b4799d550423bf369aa61832e0228c44cd8375055a2c8fa1878

Contents?: true

Size: 859 Bytes

Versions: 3

Compression:

Stored size: 859 Bytes

Contents

require 'spec_helper'

describe Riak::Crdt::InnerFlag do
  let(:parent){ double 'parent' }
  describe 'a truthy flag' do
    subject { described_class.new parent, true }

    it 'should feel truthy' do
      expect(subject).to be
    end
  end
  
  describe 'a falsey flag' do
    subject { described_class.new parent, false }

    it 'should feel falsey' do
      expect(subject).to_not be
    end
  end

  describe 'updating' do
    let(:new_value){ false }
    
    it 'should ask the class for an update operation' do
      operation = described_class.update(new_value)

      expect(operation.value).to eq new_value
      expect(operation.type).to eq :flag
    end
  end

  describe 'deleting' do
    it 'should ask the class for a delete operation' do
      operation = described_class.delete

      expect(operation.type).to eq :flag
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
riak-client-2.0.0 spec/riak/crdt/inner_flag_spec.rb
riak-client-2.0.0.rc2 spec/riak/crdt/inner_flag_spec.rb
riak-client-2.0.0.rc1 spec/riak/crdt/inner_flag_spec.rb