Sha256: 266e461c3e6af5ae6d60093c8323574a9502eaba08ea4f77eaeb976de655563c

Contents?: true

Size: 665 Bytes

Versions: 11

Compression:

Stored size: 665 Bytes

Contents

shared_examples :create do
  it 'creates the given key' do
    store.create('key','value').should be true
    store['key'].should == 'value'
  end

  it 'creates raw value with the given key' do
    store.raw.create('key','value').should be true
    store.raw['key'].should == 'value'
  end

  it 'does not create a key if it exists' do
    store['key'] = 'value'
    store.create('key','another value').should be false
    store['key'].should == 'value'
  end

  it 'supports Mutex' do
    a = Moneta::Mutex.new(store, 'mutex')
    b = Moneta::Mutex.new(store, 'mutex')
    a.lock.should be true
    b.try_lock.should be false
    a.unlock.should be_nil
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
moneta-1.5.2 spec/features/create.rb
moneta-1.5.1 spec/features/create.rb
moneta-1.5.0 spec/features/create.rb
moneta-1.4.2 spec/features/create.rb
moneta-1.4.1 spec/features/create.rb
moneta-1.4.0 spec/features/create.rb
moneta-1.3.0 spec/features/create.rb
moneta-1.2.1 spec/features/create.rb
moneta-1.2.0 spec/features/create.rb
moneta-1.1.1 spec/features/create.rb
moneta-1.1.0 spec/features/create.rb