Permalink
Browse files

Merge pull request #39 from romand-ironio/master

adding quick run test
  • Loading branch information...
2 parents 76aebe5 + 9f1240c commit 20bc29b8637177e424016582bab20d8084966a0b romand-ironio committed Apr 30, 2012
Showing with 34 additions and 0 deletions.
  1. +34 −0 test/test_quick_run.rb
View
34 test/test_quick_run.rb
@@ -0,0 +1,34 @@
+require 'helpers'
+
+class QuickRunTest < IWNGTest
+
+ N_TASKS = 50
+
+ def setup
+ super
+ client.codes.create code_bundle(:name => 'test',
+ :exec => 'test/hello.rb')
+ end
+
+ def test_quick_run
+ task_ids = []
+ N_TASKS.times do
+ task_ids << client.tasks.create('test').id
+ end
+
+ task_ids.each do |id|
+ task = client.tasks.wait_for(id)
+ assert_equal 'complete', task.status
+ assert_equal "hello\n", client.tasks.log(id)
+ end
+ end
+
+ def test_scheduler_quick
+ id = client.schedules.create(:start_at => Time.now + 10).id
+ sc = client.schedules.wait_for(id)
+ assert_equal id, sc.id
+ assert_equal "complete", sc.status
+ assert_equal "hello\n", client.schedules.log(sc.id)
+ end
+
+end

0 comments on commit 20bc29b

Please sign in to comment.