rutema 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,8 @@
1
- == 1.0.6 / 2009-09-4
1
+ == 1.0.7 / 2009-09-11
2
+ * Steps now include the commandline (if there) in their name - makes the logs more readable
3
+ * Added a check for nil states to ensure reporters always get valid data
4
+ * activerecord dependency is now 2.3.4
5
+ == 1.0.6 / 2009-09-04
2
6
  * The run context is now passed to the runner and subsequently to the TestStep#run method
3
7
  This way you can pass informaton to the command being run (context contains information on the start time of the run, the spec filename as well as any information added in the configuration)
4
8
  * Minor bugfix in the activerecord reporter to avoid crashes due to nil runner states
data/Rakefile CHANGED
@@ -3,6 +3,7 @@
3
3
  $:.unshift File.join(File.dirname(__FILE__),"lib")
4
4
  $:.unshift File.join(File.dirname(__FILE__),"ext")
5
5
  require 'rubygems'
6
+ require 'rutema/gems'
6
7
  require 'hoe'
7
8
  require 'rutema/system'
8
9
 
@@ -18,9 +19,9 @@ Hoe.spec('rutema') do |p|
18
19
  p.extra_deps<<['patir',">=0.6.4"]
19
20
  p.extra_deps<<['highline']
20
21
  p.extra_deps<<['mailfactory']
21
- p.extra_deps<<['activerecord','=2.3.2']
22
- p.extra_deps<<['ruport','=1.6.1']
23
- p.extra_deps<<['acts_as_reportable','=1.1.1']
22
+ p.extra_deps<<['activerecord','2.3.4']
23
+ p.extra_deps<<['ruport','1.6.1']
24
+ p.extra_deps<<['acts_as_reportable','1.1.1']
24
25
  p.spec_extras={:executables=>["rutemax","rutema_upgrader"],
25
26
  :default_executable=>"rutemax"}
26
27
  end
data/lib/rutema/gems.rb CHANGED
@@ -1,3 +1,3 @@
1
- gem 'activerecord','=2.3.2'
1
+ gem 'activerecord','2.3.4'
2
2
  gem 'patir',">=0.6.4"
3
3
  gem 'acts_as_reportable','=1.1.1'
@@ -78,6 +78,7 @@ module Rutema
78
78
  run_entry.scenarios<<sc
79
79
  end
80
80
  run_entry.save!
81
+ "activerecord reporter done"
81
82
  end
82
83
 
83
84
  def to_s
@@ -1,6 +1,7 @@
1
1
  # Copyright (c) 2007 Vassilis Rizopoulos. All rights reserved.
2
2
  $:.unshift File.join(File.dirname(__FILE__),"..")
3
3
  require 'rutema/reporters/standard_reporters'
4
+ require 'patir/command'
4
5
 
5
6
  module Rutema
6
7
  #This module adds functionality that allows us to
@@ -169,7 +170,7 @@ module Rutema
169
170
  end
170
171
 
171
172
  def name
172
- return @attributes[:step_type]
173
+ return name_with_parameters
173
174
  end
174
175
  def output
175
176
  return "" unless @attributes[:cmd]
@@ -201,11 +202,29 @@ module Rutema
201
202
  def reset
202
203
  @attributes[:cmd].reset if @attributes[:cmd]
203
204
  end
205
+ def name_with_parameters
206
+ param=" - #{self.cmd.to_s}" if self.has_cmd?
207
+ return "#{@attributes[:step_type]}#{param}"
208
+ end
204
209
  def to_s
205
- msg="#{self.number} - #{self.step_type} - #{self.status}"
210
+ param=""
211
+ param=" - #{self.cmd.to_s}" if self.has_cmd?
212
+ msg="#{self.number} - #{self.step_type}#{param} - #{self.status}"
206
213
  msg<<" in #{self.included_in}" if self.has_included_in?
207
214
  return msg
208
215
  end
209
216
  end
210
217
 
218
+ end
219
+
220
+ class Patir::ShellCommand
221
+ def to_s
222
+ return @command
223
+ end
224
+ end
225
+
226
+ class Patir::RubyCommand
227
+ def to_s
228
+ return @name
229
+ end
211
230
  end
data/lib/rutema/system.rb CHANGED
@@ -13,7 +13,7 @@ module Rutema
13
13
  module Version
14
14
  MAJOR=1
15
15
  MINOR=0
16
- TINY=6
16
+ TINY=7
17
17
  STRING=[ MAJOR, MINOR, TINY ].join( "." )
18
18
  end
19
19
  #The Elements module provides the namespace for the various modules adding parser functionality
@@ -338,7 +338,11 @@ module Rutema
338
338
  def report
339
339
  #get the states from the runner
340
340
  @runner.states.each do |k,v|
341
- @test_states[k]=v
341
+ if v
342
+ @test_states[k]=v
343
+ else
344
+ @logger.warn("State for #{k} is nil")
345
+ end
342
346
  end
343
347
  threads=Array.new
344
348
  #get the runner stati and the configuration and give it to the reporters
@@ -570,7 +574,7 @@ module Rutema
570
574
  return state
571
575
  end
572
576
  def run_step step
573
- @logger.info("Running step #{step.number} - #{step.step_type}")
577
+ @logger.info("Running step #{step.number} - #{step.name}")
574
578
  if step.has_cmd? && step.cmd.respond_to?(:run)
575
579
  step.cmd.run(@context)
576
580
  else
@@ -1,6 +1,8 @@
1
1
  $:.unshift File.join(File.dirname(__FILE__),"..","lib")
2
2
 
3
3
  require 'test/unit'
4
+ require 'rubygems'
5
+ require 'rutema/gems'
4
6
  #$DEBUG=true
5
7
  module TestRutema
6
8
  require 'rutema/system'
data/test/test_model.rb CHANGED
@@ -4,6 +4,7 @@ require 'test/unit'
4
4
  require 'rutema/model'
5
5
  require 'fileutils'
6
6
  require 'rubygems'
7
+ require 'rutema/gems'
7
8
  require 'active_record/fixtures'
8
9
 
9
10
  module TestRutema
Binary file
@@ -1,6 +1,7 @@
1
1
  $:.unshift File.join(File.dirname(__FILE__),"..","lib")
2
2
  require 'test/unit'
3
-
3
+ require 'rubygems'
4
+ require 'rutema/gems'
4
5
  module TestRutema
5
6
  require 'rutema/specification'
6
7
  class DummyCommand
@@ -10,6 +11,9 @@ module TestRutema
10
11
  @output="output"
11
12
  @error="error"
12
13
  end
14
+ def to_s
15
+ return ""
16
+ end
13
17
  end
14
18
  class Dummy
15
19
  include Rutema::SpecificationElement
@@ -19,7 +23,7 @@ module TestRutema
19
23
  step=Rutema::TestStep.new("test step",DummyCommand.new())
20
24
  assert(!step.attended?, "attended?")
21
25
  assert_not_equal("dummy", step.name)
22
- assert_equal("step", step.name)
26
+ assert_equal("step - ", step.name)
23
27
  assert_equal("output", step.output)
24
28
  assert_equal("error", step.error)
25
29
  assert_equal(:not_executed, step.status)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rutema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vassilis Rizopoulos
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-04 00:00:00 +02:00
12
+ date: 2009-09-11 00:00:00 +02:00
13
13
  default_executable: rutemax
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - "="
52
52
  - !ruby/object:Gem::Version
53
- version: 2.3.2
53
+ version: 2.3.4
54
54
  version:
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: ruport