Sha256: 8599d87a917f6a9794cfa94fd075c2b6372987cd66aa6419d6e204d006179dd8

Contents?: true

Size: 742 Bytes

Versions: 7

Compression:

Stored size: 742 Bytes

Contents

require 'spec_helper'

describe Storey, "#drop" do
  context "when suffix is set" do
    before do
      Storey.suffix = "bar"
      Storey.create "foo"
    end

    it "should drop the schema with the suffix" do
      Storey.drop "foo"
      Storey.schemas.should_not include("foo")
    end
  end

  context "when suffix is not set" do
    it "should drop the schema without the suffix" do
      Storey.create "foobar"
      Storey.drop "foobar"
      Storey.schemas.should_not include("foobar")
    end
  end

  context "when the schema does not exist" do
    it "should raise an error" do
      expect {
        Storey.drop "foobar"
      }.to raise_error(Storey::SchemaNotFound, %{The schema "foobar" cannot be found.})
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
storey-0.3.4 spec/storey/drop_spec.rb
storey-0.3.3 spec/storey/drop_spec.rb
storey-0.3.1 spec/storey/drop_spec.rb
storey-0.3.0 spec/storey/drop_spec.rb
storey-0.2.0 spec/storey/drop_spec.rb
storey-0.1.0 spec/storey/drop_spec.rb
storey-0.0.1 spec/storey/drop_spec.rb