Skip to content

Commit

Permalink
schema tests now just ensure the schema_search_path starts with the i…
Browse files Browse the repository at this point in the history
…ntended schema rather than checking strict equality
  • Loading branch information
bradrobertson committed May 31, 2012
1 parent 0696d5d commit d68cc6c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spec/examples/schema_adapter_examples.rb
Expand Up @@ -37,11 +37,11 @@

subject.create(schema2) do
@count = User.count
connection.schema_search_path.should == schema2
connection.schema_search_path.should start_with schema2
User.create
end

connection.schema_search_path.should_not == schema2
connection.schema_search_path.should_not start_with schema2

subject.process(schema2){ User.count.should == @count + 1 }
end
Expand Down Expand Up @@ -82,7 +82,7 @@
describe "#process" do
it "should connect" do
subject.process(schema1) do
connection.schema_search_path.should == schema1
connection.schema_search_path.should start_with schema1
end
end

Expand All @@ -103,7 +103,7 @@
describe "#switch" do
it "should connect to new schema" do
subject.switch(schema1)
connection.schema_search_path.should == schema1
connection.schema_search_path.should start_with schema1
end

it "should reset connection if database is nil" do
Expand All @@ -122,6 +122,7 @@
subject.create(1234)
expect {
subject.switch(1234)
connection.schema_search_path.should start_with '1234'
}.to_not raise_error
end

Expand Down

0 comments on commit d68cc6c

Please sign in to comment.