Skip to content

Commit

Permalink
adding Hudson::Build test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Druwerd committed Oct 5, 2011
1 parent b007627 commit e27f8c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions test/test_hudson_build.rb
Expand Up @@ -5,8 +5,21 @@
class TestHudsonBuild < Test::Unit::TestCase

def test_init
# TODO: load hudson build fixtures
#assert Hudson::Build.new('test_job')
assert Hudson::Job.new('test_job').build
assert Hudson::Build.new('test_job')
end

def test_build_info
build = Hudson::Build.new('test_job')
assert_equal build.job.name, 'test_job'

assert build.number.to_i > 0

assert build.revisions

assert_equal build.result, "SUCCESS"

assert_nil build.culprit
end

end
2 changes: 1 addition & 1 deletion test/test_hudson_job.rb
Expand Up @@ -57,6 +57,6 @@ def test_copy

def test_url
job = Hudson::Job.get("test_job")
assert_equal(job.url, "http://localhost:8080/job/#{job.name}")
assert_equal(job.url, "http://localhost:8080/job/#{job.name}/")
end
end

0 comments on commit e27f8c3

Please sign in to comment.