Skip to content

Commit 6423ab1

Browse files
committed
Fix tests with json dump problems
1 parent 552e0ff commit 6423ab1

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

test/ecto/adapters/sqlite3/connection/migration_test.exs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,12 @@ defmodule Ecto.Adapters.SQLite3.Connection.MigrationTest do
176176
{:add, :a, :map, [default: %{foo: "bar", baz: "boom"}]}
177177
]}
178178

179-
assert execute_ddl(create) == [
180-
~s|CREATE TABLE "posts" ("a" TEXT DEFAULT ('{"baz":"boom","foo":"bar"}'))|
181-
]
179+
assert [statement] = execute_ddl(create)
180+
181+
# CREATE TABLE "posts" ("a" TEXT DEFAULT ('{"foo":"bar","baz":"boom"}'))
182+
assert statement =~ ~r|CREATE TABLE "posts" \("a" TEXT DEFAULT \(.*\)\)|
183+
assert statement =~ ~s("foo":"bar")
184+
assert statement =~ ~s("baz":"boom")
182185
end
183186

184187
test "create table with a map column, and a string default" do
@@ -188,9 +191,12 @@ defmodule Ecto.Adapters.SQLite3.Connection.MigrationTest do
188191
{:add, :a, :map, [default: ~s|{"foo":"bar","baz":"boom"}|]}
189192
]}
190193

191-
assert execute_ddl(create) == [
192-
~s|CREATE TABLE "posts" ("a" TEXT DEFAULT '{"foo":"bar","baz":"boom"}')|
193-
]
194+
assert [statement] = execute_ddl(create)
195+
196+
# CREATE TABLE "posts" ("a" TEXT DEFAULT '{"foo":"bar","baz":"boom"}')
197+
assert statement =~ ~r|CREATE TABLE "posts" \("a" TEXT DEFAULT '\{.*\}'\)|
198+
assert statement =~ ~s("foo":"bar")
199+
assert statement =~ ~s("baz":"boom")
194200
end
195201

196202
test "create table with time columns" do

0 commit comments

Comments
 (0)