Sha256: 0706986a41d9f640e6a81727bc2546da9ce61cd77e66a92205022aaeeaf018e8

Contents?: true

Size: 931 Bytes

Versions: 3

Compression:

Stored size: 931 Bytes

Contents

require 'spec_helper'

describe Storey, "#schema" do
  it "should return the current schema" do
    Storey.schema.should == %{"$user",public}
  end

  context "array: true" do
    it "returns it as an array of strings" do
      expect(Storey.schema(array: true)).to eq %w("$user" public)
    end
  end

  context "when a suffix is set" do
    before do
      Storey.suffix = "_rock"
      Storey.create "hello"
      Storey.switch "hello"
    end

    it "should return the schema without the suffix by default" do
      Storey.schema.should == "hello"
    end

    context "when :suffix => true" do
      it "should return the schema with the suffix" do
        Storey.schema(:suffix => true).should include("hello_rock")
      end
    end

    context "when :suffix => false" do
      it "should return the schema without the suffix" do
        Storey.schema(:suffix => false).should include("hello")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
storey-2.0.2 spec/storey/schema_spec.rb
storey-2.0.1 spec/storey/schema_spec.rb
storey-2.0.0 spec/storey/schema_spec.rb