Sha256: 6061cb6f1c8289522dea9b75d51429423c472abcd965c9bf54aba780dc4701c8
Contents?: true
Size: 943 Bytes
Versions: 11
Compression:
Stored size: 943 Bytes
Contents
require 'test_helper' require 'chillout/creations_container' class WorkerIntegrationTest < ChilloutTestCase def setup @_api_key = "xyz123" stub_request(:post, api_url('clients')).to_return(:body => "OK", :status => 200) stub_request(:post, api_url('metrics')).to_return(:body => "OK", :status => 200) end def test_worker_running_after_fork_on_first_use return if RUBY_PLATFORM == 'java' client = Chillout::Client.new(@_api_key, :logger => null_logger) worker_check = Proc.new do client.enqueue(Chillout::CreationsContainer.new) client.worker_running? ? Process.exit!(0) : Process.exit!(28) end assert_successful_exit Process.fork(&worker_check) end def test_worker_running_lazily client = Chillout::Client.new(@_api_key, :logger => null_logger) assert !client.worker_running? client.enqueue(Chillout::CreationsContainer.new) assert client.worker_running? end end
Version data entries
11 entries across 11 versions & 1 rubygems