Sha256: eea60f534528e76f3103f4c2496380df36e0a78059f387f3afdbc9a9c9a16b74

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 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 'feels truthy' do
      expect(subject).to be
    end
  end

  describe 'a falsey flag' do
    subject { described_class.new parent, false }

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

  describe 'updating' do
    let(:new_value){ false }

    it '\asks 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 'asks the class for a delete operation' do
      operation = described_class.delete

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

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
riak-client-2.2.2 spec/riak/crdt/inner_flag_spec.rb
riak-client-2.2.1 spec/riak/crdt/inner_flag_spec.rb
riak-client-noenc-1.0.0 spec/riak/crdt/inner_flag_spec.rb
riak-client-2.2.0 spec/riak/crdt/inner_flag_spec.rb