Permalink
Browse files

rename class Process to Build

  • Loading branch information...
1 parent e0aae95 commit 95eb80e4a0da95a78b72627443c5427f34281c4f @jugyo committed Jan 6, 2010
@@ -1,5 +1,5 @@
module CiLite
- class Process < Struct.new(:status, :pid)
+ class Build < Struct.new(:status, :pid)
attr_reader :command, :status, :pid, :output
def initialize(command)
View
@@ -40,11 +40,11 @@ def test_if_updated
end
def test(hash)
- process = Process.new(config[:test_command])
- process.start
- puts "#{hash} => #{process.status}"
- puts process.output
- Log[hash] = process.to_hash.merge(
+ build = Build.new(config[:test_command])
+ build.start
+ puts "#{hash} => #{build.status}"
+ puts build.output
+ Log[hash] = build.to_hash.merge(
:hash => hash,
:created_at => Time.now,
:branch => config[:branch]
@@ -1,10 +1,10 @@
require 'helper'
require 'tmpdir'
-class TestProcess < Test::Unit::TestCase
+class TestBuild < Test::Unit::TestCase
context 'main' do
setup do
- @test = CiLite::Process.new('foo')
+ @test = CiLite::Build.new('foo')
end
should 'pass the test' do
View
@@ -11,12 +11,12 @@ class TestRunner < Test::Unit::TestCase
end
should 'test if updated' do
- test_process_stub = Object.new
- mock(test_process_stub).start
- stub(test_process_stub).to_hash { {:foo => :bar} }
- stub(test_process_stub).status { 0 }
- stub(test_process_stub).output { 'output' }
- mock(CiLite::Process).new(@runner.config[:test_command]) { test_process_stub }
+ test_build_stub = Object.new
+ mock(test_build_stub).start
+ stub(test_build_stub).to_hash { {:foo => :bar} }
+ stub(test_build_stub).status { 0 }
+ stub(test_build_stub).output { 'output' }
+ mock(CiLite::Build).new(@runner.config[:test_command]) { test_build_stub }
mock(CiLite::Log).[]=.with_any_args
stub(Time).now { 'now' }

0 comments on commit 95eb80e

Please sign in to comment.