- for
rake
rails
application is required fromRakefile
- for
rake
before requiring gemsrails
setsRAILS_ENV
(if not set yet) - the default
rake
task istest
TESTOPTS
can be used to pass parameters tominitest
rails
'test
task inherits fromRake::TestTask
- before running tests
rails
runsdb:test:prepare
->db:test:load
->db:test:purge
(drop + create) ->db:test:load_schema
- the last one loads
db/schema.rb
which brings the db to the appropriate state - if after that there are still unapplied migrations, it instructs to apply them
- alternatively you can run
bin/rake db:migrate
which will apply the migrations to the development db, and as such updatedb/schema.rb
- but if all test migrations get unapplied, and
db/schema.rb
containsversion: 0
,db:test:load_schema
puts0
into theschema_migrations
table, and fails (since the upcoming migrations are unapplied), this can be resolved by removing the test database, and runningdb:migrate
- the last one loads
rails s
(or ratherwebrick
) starts a thread for each request, as suchpry
's!!!
doesn't have the effect
Last active
February 9, 2021 02:17
-
-
Save x-yuri/bcd300a7a3e614a0d25d674487b370fb to your computer and use it in GitHub Desktop.
#rails #ruby #minitest #rake #pry #pry-byebug
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment