Sha256: 38bf6ac8947b9a0e004faa6eb2245e7e083a98e53a328a2da7d5c3e43240da41

Contents?: true

Size: 799 Bytes

Versions: 4

Compression:

Stored size: 799 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Adapter::Memory, '.new' do
  context 'with a schema' do
    subject { described_class.new(schema) }

    let(:schema) { {} }

    it { should be_instance_of(described_class) }

    it 'creates a new thread safe hash for the schema' do
      klass = double('ThreadSafe::Hash')
      expect(klass).to receive(:new).and_return({})
      stub_const('ThreadSafe::Hash', klass)
      subject
    end
  end

  context 'without a schema' do
    subject { described_class.new }

    it { should be_instance_of(described_class) }

    it 'creates a new thread safe hash for the schema' do
      klass = double('ThreadSafe::Hash')
      expect(klass).to receive(:new).and_return({})
      stub_const('ThreadSafe::Hash', klass)
      subject
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
axiom-memory-adapter-0.2.1 spec/unit/axiom/adapter/memory/class_methods/new_spec.rb
axiom-memory-adapter-0.2.0 spec/unit/axiom/adapter/memory/class_methods/new_spec.rb
axiom-memory-adapter-0.0.3 spec/unit/axiom/adapter/memory/class_methods/new_spec.rb
axiom-memory-adapter-0.0.2 spec/unit/axiom/adapter/memory/class_methods/new_spec.rb