Add start and stop instead of Spec.before_each and Spec.after_each

This commit is contained in:
Sdogruyol 2016-04-10 16:52:39 +03:00
parent ee61ecfdf1
commit a318920bcc
1 changed files with 4 additions and 5 deletions

View File

@ -9,7 +9,7 @@ APP_URL = "http://localhost:#{APP_PORT}"
Kemal.config.env = APP_ENV Kemal.config.env = APP_ENV
Kemal.config.port = APP_PORT Kemal.config.port = APP_PORT
Spec.before_each do def start
spawn do spawn do
Kemal.run Kemal.run
Kemal.config.server.listen Kemal.config.server.listen
@ -17,10 +17,9 @@ Spec.before_each do
sleep TIME_TO_SLEEP sleep TIME_TO_SLEEP
end end
Spec.after_each do def stop
spawn do Kemal.config.server.close
Kemal.config.server.close sleep TIME_TO_SLEEP
end
end end
{% for method in %w(get post put head delete patch) %} {% for method in %w(get post put head delete patch) %}