features/steps/flapjack-worker_steps.rb in flapjack-0.5.5 vs features/steps/flapjack-worker_steps.rb in flapjack-0.6.23

- old
+ new

@@ -12,19 +12,15 @@ end When /^I background run "flapjack-worker"$/ do @root = Pathname.new(File.dirname(__FILE__)).parent.parent.expand_path bin_path = @root.join('bin') - command = "#{bin_path}/flapjack-worker 2>&1" + command = "ruby -rubygems #{bin_path}/flapjack-worker 2>&1" - @worker = IO.popen(command, 'r') + @worker = spawn_daemon(command) sleep 1 - - at_exit do - Process.kill("KILL", @worker.pid) - end end Then /^I should see "([^"]*)" in the "([^"]*)" output$/ do |string, command| instance_variable_name = "@" + command.split("-")[1] pipe = instance_variable_get(instance_variable_name) @@ -56,6 +52,17 @@ puts @output end When /^I sleep "(\d+)" seconds$/ do |time| sleep(time.to_i) +end + +When /^I insert a check onto the beanstalk$/ do + @queue = Beanstalk::Connection.new('localhost:11300', 'checks') + + + pending # express the regexp above with the code you wish you had +end + +Then /^I should see a job on the "([^"]*)" beanstalk queue$/ do |arg1| + pending # express the regexp above with the code you wish you had end