@@ -176,9 +176,12 @@ defmodule Ecto.Adapters.SQLite3.Connection.MigrationTest do
176
176
{ :add , :a , :map , [ default: % { foo: "bar" , baz: "boom" } ] }
177
177
] }
178
178
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")
182
185
end
183
186
184
187
test "create table with a map column, and a string default" do
@@ -188,9 +191,12 @@ defmodule Ecto.Adapters.SQLite3.Connection.MigrationTest do
188
191
{ :add , :a , :map , [ default: ~s| {"foo":"bar","baz":"boom"}| ] }
189
192
] }
190
193
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")
194
200
end
195
201
196
202
test "create table with time columns" do
0 commit comments