aboutsummaryrefslogtreecommitdiffstats
path: root/test/support/integration/adapters/sneakers.rb
diff options
context:
space:
mode:
authorCristian Bica <cristian.bica@gmail.com>2014-08-05 09:05:14 +0300
committerCristian Bica <cristian.bica@gmail.com>2014-08-08 10:52:16 +0300
commit664546c208c406bba08b8eda2e6a600154d7232e (patch)
tree5a4c62c14e115ff4ee05212664bb2ff5b8595c38 /test/support/integration/adapters/sneakers.rb
parent06ccd5f405a004275915102eb3ccc42b952ba549 (diff)
downloadrails-664546c208c406bba08b8eda2e6a600154d7232e.tar.gz
rails-664546c208c406bba08b8eda2e6a600154d7232e.tar.bz2
rails-664546c208c406bba08b8eda2e6a600154d7232e.zip
Integration testing
Diffstat (limited to 'test/support/integration/adapters/sneakers.rb')
-rw-r--r--test/support/integration/adapters/sneakers.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/support/integration/adapters/sneakers.rb b/test/support/integration/adapters/sneakers.rb
new file mode 100644
index 0000000000..5dcab68515
--- /dev/null
+++ b/test/support/integration/adapters/sneakers.rb
@@ -0,0 +1,18 @@
+require 'sneakers/runner'
+
+module SneakersJobsManager
+ def clear_jobs
+ end
+
+ def start_workers
+ cmd = %{cd #{Rails.root.to_s} && (RAILS_ENV=test AJADAPTER=sneakers WORKERS=ActiveJob::QueueAdapters::SneakersAdapter::JobWrapper bundle exec rake --trace sneakers:run)}
+ `#{cmd}`
+ while !Rails.root.join("tmp/sneakers.pid").exist? do
+ sleep 0.5
+ end
+ end
+
+ def stop_workers
+ Process.kill 'TERM', File.open(Rails.root.join("tmp/sneakers.pid").to_s).read.to_i
+ end
+end