Sha256: 21609115616ec6838ae710e298be5178564eef276e914f4175be7024697e0f03

Contents?: true

Size: 829 Bytes

Versions: 7

Compression:

Stored size: 829 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

7 entries across 7 versions & 1 rubygems

Version Path
riak-client-2.5.0 spec/riak/crdt/inner_flag_spec.rb
riak-client-2.4.1 spec/riak/crdt/inner_flag_spec.rb
riak-client-2.4.0 spec/riak/crdt/inner_flag_spec.rb
riak-client-2.4.0.pre1 spec/riak/crdt/inner_flag_spec.rb
riak-client-2.3.2 spec/riak/crdt/inner_flag_spec.rb
riak-client-2.3.1 spec/riak/crdt/inner_flag_spec.rb
riak-client-2.3.0 spec/riak/crdt/inner_flag_spec.rb