mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Add explicit hashes to avoid ambiguity with keyword arguments
This commit is contained in:
parent
5e7c43f014
commit
ead2f5aa5c
1 changed files with 3 additions and 3 deletions
|
@ -98,7 +98,7 @@ module DatabaseCleaner
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should pass all arguments to strategy initializer" do
|
it "should pass all arguments to strategy initializer" do
|
||||||
expect(strategy_class).to receive(:new).with(:dollar, :amet, ipsum: "random").and_return(strategy)
|
expect(strategy_class).to receive(:new).with(:dollar, :amet, { ipsum: "random" }).and_return(strategy)
|
||||||
expect(strategy).to receive(:clean)
|
expect(strategy).to receive(:clean)
|
||||||
cleaner.clean_with :truncation, :dollar, :amet, ipsum: "random"
|
cleaner.clean_with :truncation, :dollar, :amet, ipsum: "random"
|
||||||
end
|
end
|
||||||
|
@ -145,12 +145,12 @@ module DatabaseCleaner
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should proxy params with symbolised strategies in an array" do
|
it "should proxy params with symbolised strategies in an array" do
|
||||||
expect(strategy_class).to receive(:new).with(param: "one")
|
expect(strategy_class).to receive(:new).with({ param: "one" })
|
||||||
cleaner.strategy = [:truncation, param: "one"]
|
cleaner.strategy = [:truncation, param: "one"]
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should proxy params with symbolised strategies in a separate hash" do
|
it "should proxy params with symbolised strategies in a separate hash" do
|
||||||
expect(strategy_class).to receive(:new).with(param: "one")
|
expect(strategy_class).to receive(:new).with({ param: "one" })
|
||||||
cleaner.strategy = :truncation, { param: "one" }
|
cleaner.strategy = :truncation, { param: "one" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue