Sha256: 5a2ba40496c6c3c7c7cf0198c02fbd515031e095ae1885fc1c04c9ef595bb68b

Contents?: true

Size: 965 Bytes

Versions: 340

Compression:

Stored size: 965 Bytes

Contents

shared_examples_for "A Memory Terminus" do
  it "should find no instances by default" do
    expect(@searcher.find(@request)).to be_nil
  end

  it "should be able to find instances that were previously saved" do
    @searcher.save(@request)
    expect(@searcher.find(@request)).to equal(@instance)
  end

  it "should replace existing saved instances when a new instance with the same name is saved" do
    @searcher.save(@request)
    two = double('second', :name => @name)
    trequest = double('request', :key => @name, :instance => two)
    @searcher.save(trequest)
    expect(@searcher.find(@request)).to equal(two)
  end

  it "should be able to remove previously saved instances" do
    @searcher.save(@request)
    @searcher.destroy(@request)
    expect(@searcher.find(@request)).to be_nil
  end

  it "should fail when asked to destroy an instance that does not exist" do
    expect { @searcher.destroy(@request) }.to raise_error(ArgumentError)
  end
end

Version data entries

340 entries across 340 versions & 1 rubygems

Version Path
puppet-8.3.0 spec/shared_behaviours/memory_terminus.rb
puppet-8.3.0-x86-mingw32 spec/shared_behaviours/memory_terminus.rb
puppet-8.3.0-x64-mingw32 spec/shared_behaviours/memory_terminus.rb
puppet-8.3.0-universal-darwin spec/shared_behaviours/memory_terminus.rb
puppet-8.4.0 spec/shared_behaviours/memory_terminus.rb
puppet-8.4.0-x86-mingw32 spec/shared_behaviours/memory_terminus.rb
puppet-8.4.0-x64-mingw32 spec/shared_behaviours/memory_terminus.rb
puppet-8.4.0-universal-darwin spec/shared_behaviours/memory_terminus.rb
puppet-7.28.0 spec/shared_behaviours/memory_terminus.rb
puppet-7.28.0-x86-mingw32 spec/shared_behaviours/memory_terminus.rb
puppet-7.28.0-x64-mingw32 spec/shared_behaviours/memory_terminus.rb
puppet-7.28.0-universal-darwin spec/shared_behaviours/memory_terminus.rb
puppet-8.3.1 spec/shared_behaviours/memory_terminus.rb
puppet-8.3.1-x86-mingw32 spec/shared_behaviours/memory_terminus.rb
puppet-8.3.1-x64-mingw32 spec/shared_behaviours/memory_terminus.rb
puppet-8.3.1-universal-darwin spec/shared_behaviours/memory_terminus.rb
puppet-7.27.0 spec/shared_behaviours/memory_terminus.rb
puppet-7.27.0-x86-mingw32 spec/shared_behaviours/memory_terminus.rb
puppet-7.27.0-x64-mingw32 spec/shared_behaviours/memory_terminus.rb
puppet-7.27.0-universal-darwin spec/shared_behaviours/memory_terminus.rb