Skip to content

Instantly share code, notes, and snippets.

@elfenlaid
Created March 30, 2021 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elfenlaid/c3c1b8dc3039f8a24a8bb3075a0b9d91 to your computer and use it in GitHub Desktop.
Save elfenlaid/c3c1b8dc3039f8a24a8bb3075a0b9d91 to your computer and use it in GitHub Desktop.
defmodule EctoMigrationTest do
use ExUnit.Case
def rollback, do: Mix.Shell.IO.cmd("MIX_ENV=test mix ecto.rollback --all")
def migrate, do: Mix.Shell.IO.cmd("MIX_ENV=test mix ecto.migrate")
test "test rollback and migration" do
assert 0 == rollback()
assert 0 == migrate()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment