Skip to content

Commit

Permalink
Refactor geometry schema dump tests for consistency and clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff.dean committed Mar 4, 2025
1 parent d227881 commit 33d879e
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions test/tasks_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,13 @@ def test_basic_geography_schema_dump
ActiveRecord::SchemaDumper.dump(connection, file)
end
data = File.read(tmp_sql_filename)
if connection.database_version >= "8.0.0"
assert_includes data, %(t.geometry "latlon1", limit: {type: "point", srid: 0})
if connection.supports_index_sort_order?
assert_includes(data,
%(t.geometry "latlon2", limit: {type: "point", srid: 4326}))
else
assert_includes(data,
%(t.geometry "latlon2", limit: {type: "point", srid: 0}))
end
assert_includes data, %(t.geometry "latlon1", limit: {:type=>"point", :srid=>0})
if connection.supports_index_sort_order?
assert_includes(data,
%(t.geometry "latlon2", limit: {:type=>"point", :srid=>4326}))
else
assert_includes data, %(t.geometry "latlon1", limit: {:type=>"point", :srid=>0})
if connection.supports_index_sort_order?
assert_includes(data,
%(t.geometry "latlon2", limit: {:type=>"point", :srid=>4326}))
else
assert_includes(data,
%(t.geometry "latlon2", limit: {:type=>"point", :srid=>0}))
end
assert_includes(data,
%(t.geometry "latlon2", limit: {:type=>"point", :srid=>0}))
end
end

Expand Down

0 comments on commit 33d879e

Please sign in to comment.