Patch #41954 » test_extract_fixture.sh
| 1 |
#!/bin/bash
|
|---|---|
| 2 |
set -eux |
| 3 |
|
| 4 |
adapter=$1 |
| 5 |
|
| 6 |
# Load test fixtures
|
| 7 |
bundle exec rake db:drop && bundle exec rake db:create && bundle exec rake db:migrate && \ |
| 8 |
bundle exec rake db:fixtures:load
|
| 9 |
|
| 10 |
# Save fixtures (1st)
|
| 11 |
bundle exec rake extract_fixtures DIR=./tmp/fixtures/$adapter-1 |
| 12 |
|
| 13 |
# Load saved fixtures
|
| 14 |
bundle exec rake db:drop && bundle exec rake db:create && bundle exec rake db:migrate && \ |
| 15 |
bundle exec rake db:fixtures:load FIXTURES_PATH=./tmp/fixtures/$adapter-1 |
| 16 |
|
| 17 |
# Save fixtures (2nd)
|
| 18 |
bundle exec rake extract_fixtures DIR=./tmp/fixtures/$adapter-2 |
| 19 |
|
| 20 |
# Check diff
|
| 21 |
diff -u ./tmp/fixtures/$adapter-1 ./tmp/fixtures/$adapter-2 |