Sha256: 3e6ba21a107f0d208f9c156757781d450b7be48db268e75c6df605f8ef081975

Contents?: true

Size: 1.42 KB

Versions: 13

Compression:

Stored size: 1.42 KB

Contents

require 'spec_helper'

describe Storey, "#schemas" do
  context "when suffix is set" do
    before do
      Storey.suffix = "_roboto"
    end

    it "should return an array of the schemas without the suffix by default" do
      Storey.create "mr"
      Storey.schemas.should include("mr")
    end

    it "should include the public schema by default" do
      Storey.schemas.should include("public")
    end

    it "should not include any postgres schemas" do
      Storey.schemas do |schema|
        schema.should_not include("pg_")
        schema.should_not == "information_schema"
      end
    end

    context "when suffix => true" do
      it "should return an array of the schemas with the suffix" do
        Storey.create "mr"
        Storey.schemas(:suffix => true).should include("mr_roboto")
      end
    end

    context "when suffix => false" do
      it "should return an array of the schemas without the suffix" do
        Storey.create "mr"
        Storey.schemas(:suffix => false).should include("mr")
      end
    end

    context "when :public => true" do
      it "should return an array of the schemas without the public schema" do
        Storey.schemas(:public => true).should include("public")
      end
    end

    context "when :public => false" do
      it "should return an array of the schemas with the public schema" do
        Storey.schemas(:public => false).should_not include("public")
      end
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
storey-1.0.0 spec/storey/schemas_spec.rb
storey-0.6.0 spec/storey/schemas_spec.rb
storey-0.5.2 spec/storey/schemas_spec.rb
storey-0.5.1 spec/storey/schemas_spec.rb
storey-0.5.0 spec/storey/schemas_spec.rb
storey-0.4.2 spec/storey/schemas_spec.rb
storey-0.4.1 spec/storey/schemas_spec.rb
storey-0.4.0 spec/storey/schemas_spec.rb
storey-0.3.6 spec/storey/schemas_spec.rb
storey-0.3.5 spec/storey/schemas_spec.rb
storey-0.3.4 spec/storey/schemas_spec.rb
storey-0.3.3 spec/storey/schemas_spec.rb
storey-0.3.1 spec/storey/schemas_spec.rb