Skip to content

Commit

Permalink
add unit tests for additions to Job class
Browse files Browse the repository at this point in the history
  • Loading branch information
cap10morgan committed Aug 20, 2012
1 parent 33b76d0 commit 88e2ef7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/unit/job_test.rb
Expand Up @@ -7,6 +7,15 @@ class JobTest < Test::Unit::TestCase
assert_equal 'foo', new_job(:at => 'foo').at
end

should "return the :on_server_roles set when #server_roles is called" do
assert_equal ['foo', 'bar'], new_job(:on_server_roles => ['foo', 'bar']).server_roles
end

should "return whether it has a server_role from #has_server_role?" do
assert new_job(:on_server_roles => 'foo').has_server_role?('foo')
refute new_job(:on_server_roles => 'bar').has_server_role?('foo')
end

should "substitute the :task when #output is called" do
job = new_job(:template => ":task", :task => 'abc123')
assert_equal 'abc123', job.output
Expand Down

0 comments on commit 88e2ef7

Please sign in to comment.