Skip to content

Commit

Permalink
Merge pull request #43 from romand-ironio/master
Browse files Browse the repository at this point in the history
test for workerfile
  • Loading branch information
romand-ironio committed May 11, 2012
2 parents 5eb2ab7 + 3ea3d69 commit 0604bf5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/hello.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo "hello"
28 changes: 28 additions & 0 deletions test/test_workerfile.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'helpers'

class WorkerfileTest < IWNGTest

def workerfile(str)
dir = Dir.mktmpdir('workerfile_test')
File.open(dir + '/Workerfile', 'w'){ |f| f << str }.path
end

def test_basic
wf = workerfile <<EOF
runtime 'binary'
name 'ShHello'
exec 'test/hello.sh'
EOF

code = IronWorkerNG::Code.create(:workerfile => wf)

client.codes.create(code)

id = client.tasks.create('ShHello').id

client.tasks.wait_for(id)

assert_equal "hello\n", client.tasks.log(id)
end

end

0 comments on commit 0604bf5

Please sign in to comment.