cukeforker 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,11 +13,11 @@ module CukeForker
13
13
  end
14
14
 
15
15
  def on_worker_starting(worker)
16
- log.info "[ worker(#{worker.id}) ] starting: #{worker.feature}"
16
+ log.info "[ worker #{worker.id.to_s.ljust 3} ] starting: #{worker.feature}"
17
17
  end
18
18
 
19
19
  def on_worker_finished(worker)
20
- log.info "[ worker(#{worker.id}) ] finished: #{worker.feature}"
20
+ log.info "[ worker #{worker.id.to_s.ljust 3} ] finished: #{worker.feature}"
21
21
  end
22
22
 
23
23
  def on_run_finished(failed)
@@ -30,24 +30,24 @@ module CukeForker
30
30
  end
31
31
 
32
32
  def on_display_fetched(server)
33
- log.info "[ display(#{server.display.to_s.ljust(2)}) ] fetched"
33
+ log.info "[ display #{server.display.to_s.ljust(2)} ] fetched"
34
34
  end
35
35
 
36
36
  def on_display_released(server)
37
- log.info "[ display(#{server.display.to_s.ljust(2)}) ] released"
37
+ log.info "[ display #{server.display.to_s.ljust(2)} ] released"
38
38
  end
39
39
 
40
40
  def on_display_starting(server)
41
- log.info "[ display(#{server.display.to_s.ljust(2)}) ] starting"
41
+ log.info "[ display #{server.display.to_s.ljust(2)} ] starting"
42
42
  end
43
43
 
44
44
  def on_display_stopping(server)
45
- log.info "[ display(#{server.display.to_s.ljust(2)}) ] stopping"
45
+ log.info "[ display #{server.display.to_s.ljust(2)} ] stopping"
46
46
  end
47
47
 
48
48
  def on_eta(eta, remaining, finished)
49
- counts = "(#{remaining}/#{finished})".ljust(11)
50
- log.info "[ eta#{counts}] #{eta.strftime TIME_FORMAT}"
49
+ counts = "#{remaining}/#{finished}".ljust(6)
50
+ log.info "[ eta #{counts}] #{eta.strftime TIME_FORMAT}"
51
51
  end
52
52
 
53
53
  private
@@ -1,3 +1,3 @@
1
1
  module CukeForker
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -8,7 +8,9 @@ module CukeForker
8
8
  it "logs all events" do
9
9
  Time.stub(:now => Time.now)
10
10
 
11
- mock_worker = mock(Worker, :id => "1", :feature => "foo/bar")
11
+ mock_worker = mock(Worker, :id => "1", :feature => "foo/bar")
12
+ mock_worker2 = mock(Worker, :id => "15", :feature => "foo/baz")
13
+
12
14
  mock_display = mock(VncServer)
13
15
  mock_display.stub(:display).and_return(nil, ":5")
14
16
 
@@ -16,8 +18,10 @@ module CukeForker
16
18
  listener.on_display_starting mock_display
17
19
  listener.on_display_fetched mock_display
18
20
  listener.on_worker_starting mock_worker
21
+ listener.on_worker_starting mock_worker2
19
22
  listener.on_eta Time.now, 10, 255
20
23
  listener.on_worker_finished mock_worker
24
+ listener.on_worker_finished mock_worker2
21
25
  listener.on_display_released mock_display
22
26
  listener.on_run_interrupted
23
27
  listener.on_run_finished false
@@ -27,15 +31,17 @@ module CukeForker
27
31
 
28
32
  stdout.string.should == <<-OUTPUT
29
33
  I, [#{timestamp}] INFO -- : [ run ] starting
30
- I, [#{timestamp}] INFO -- : [ display( ) ] starting
31
- I, [#{timestamp}] INFO -- : [ display(:5) ] fetched
32
- I, [#{timestamp}] INFO -- : [ worker(1) ] starting: foo/bar
33
- I, [#{timestamp}] INFO -- : [ eta(10/255) ] #{Time.now.strftime "%Y-%m-%d %H:%M:%S"}
34
- I, [#{timestamp}] INFO -- : [ worker(1) ] finished: foo/bar
35
- I, [#{timestamp}] INFO -- : [ display(:5) ] released
34
+ I, [#{timestamp}] INFO -- : [ display ] starting
35
+ I, [#{timestamp}] INFO -- : [ display :5 ] fetched
36
+ I, [#{timestamp}] INFO -- : [ worker 1 ] starting: foo/bar
37
+ I, [#{timestamp}] INFO -- : [ worker 15 ] starting: foo/baz
38
+ I, [#{timestamp}] INFO -- : [ eta 10/255] #{Time.now.strftime "%Y-%m-%d %H:%M:%S"}
39
+ I, [#{timestamp}] INFO -- : [ worker 1 ] finished: foo/bar
40
+ I, [#{timestamp}] INFO -- : [ worker 15 ] finished: foo/baz
41
+ I, [#{timestamp}] INFO -- : [ display :5 ] released
36
42
  I, [#{timestamp}] INFO -- : [ run ] interrupted - please wait
37
43
  I, [#{timestamp}] INFO -- : [ run ] finished, passed
38
- I, [#{timestamp}] INFO -- : [ display(:5) ] stopping
44
+ I, [#{timestamp}] INFO -- : [ display :5 ] stopping
39
45
  OUTPUT
40
46
  end
41
47
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jari Bakken
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-21 00:00:00 +01:00
17
+ date: 2011-01-24 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency