Sha256: ac0df21ff6a2144b822e4c5e85d24c35e7b47d12d9a17d4d0c45b2cb9f0cd35f

Contents?: true

Size: 1.03 KB

Versions: 10

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe Storey, '#schema_exists?' do
  context 'the schema is the default search path' do
    it 'should return true' do
      Storey.schema_exists?('"$user",public').should be_true
    end
  end

  context 'when there is no suffix' do
    context 'when the schema exists' do
      before do
        Storey.create 'hoo'
      end

      it 'should return true' do
        Storey.schema_exists?('hoo').should be_true
      end
    end

    context 'when the schema does not exist' do
      it 'should return false' do
        Storey.schema_exists?('boo').should be_false
      end
    end
  end

  context 'when there is a suffix' do
    context 'when the schema exists' do
      before do
        Storey.suffix = '_boo'
        Storey.create 'croo'
      end

      it 'should return true' do
        Storey.schema_exists?('croo').should be_true
      end
    end

    context 'when the schema does not exist' do
      it 'should return false' do
        Storey.schema_exists?('croo').should be_false
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
storey-0.6.0 spec/storey/schema_exists_spec.rb
storey-0.5.2 spec/storey/schema_exists_spec.rb
storey-0.5.1 spec/storey/schema_exists_spec.rb
storey-0.5.0 spec/storey/schema_exists_spec.rb
storey-0.4.2 spec/storey/schema_exists_spec.rb
storey-0.4.1 spec/storey/schema_exists_spec.rb
storey-0.4.0 spec/storey/schema_exists_spec.rb
storey-0.3.6 spec/storey/schema_exists_spec.rb
storey-0.3.5 spec/storey/schema_exists_spec.rb
storey-0.3.4 spec/storey/schema_exists_spec.rb