rails db:migrate
rails routes
# Run a script in the context of a rails app
rails runner script.rb
# Run a test script
$ rails test --verbose test/test_pr.rb
# Run a test script in Rails.env='development' instead of 'test'
$ cat <<-EOF > test.rb
class TestFoo < MiniTest::Test
def test_bar
assert false
end
end
MiniTest.autorun
EOF
$ rails runner test.rb
# Run a test from stdin in Rails.env='development' instead of 'test'
$ cat <<-EOF | rails runner -
class TestFoo < MiniTest::Test
def test_bar
assert false
end
end
MiniTest.autorun
EOF