rutema 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,7 @@ README.txt
26
26
  test/distro_test/config/database.rutema
27
27
  test/distro_test/config/full.rutema
28
28
  test/distro_test/config/minimal.rutema
29
+ test/distro_test/config/test_identifiers.rutema
29
30
  test/distro_test/specs/check.spec
30
31
  test/distro_test/specs/duplicate_name.spec
31
32
  test/distro_test/specs/fail.spec
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2007-2010 Vassilis Rizopoulos. All rights reserved.
2
2
  $:.unshift File.join(File.dirname(__FILE__),"..")
3
-
3
+ require 'ostruct'
4
4
  module Rutema
5
5
  #This module defines the "configuration directives" used in the configuration of Rutema
6
6
  #
@@ -22,7 +22,7 @@ module Rutema
22
22
  module Version
23
23
  MAJOR=1
24
24
  MINOR=2
25
- TINY=1
25
+ TINY=2
26
26
  STRING=[ MAJOR, MINOR, TINY ].join( "." )
27
27
  end
28
28
  #This class coordinates parsing, execution and reporting of test specifications
@@ -38,7 +38,6 @@ module Rutema
38
38
  raise "Could not instantiate parser" unless @parser
39
39
  @reporters=@configuration.reporters.collect{ |reporter| instantiate_class(reporter) }
40
40
  @reporters.compact!
41
- @configuration.tests.collect!{|t| File.expand_path(t)}
42
41
  #this will hold any specifications that are succesfully parsed.
43
42
  @specifications=Hash.new
44
43
  @parsed_files=Array.new
@@ -161,30 +160,24 @@ module Rutema
161
160
  end
162
161
  end
163
162
 
164
- def parse_specification spec_file
165
- filename=File.expand_path(spec_file)
166
- if File.exists?(filename)
167
- begin
168
- @parsed_files<<filename
169
- @parsed_files.uniq!
170
- spec=@parser.parse_specification(spec_file)
171
- if @specifications[spec.name]
172
- msg="Duplicate specification name '#{spec.name}' in '#{spec_file}'"
173
- @logger.error(msg)
174
- @parse_errors<<{:filename=>spec_file,:error=>msg}
175
- @test_states[spec.name]=Patir::CommandSequenceStatus.new(spec.name,[])
176
- else
177
- @specifications[spec.name]=spec
178
- @test_states[spec.name]=Patir::CommandSequenceStatus.new(spec.name,spec.scenario.steps)
179
- end
180
- rescue ParserError
181
- @logger.error("Error parsing '#{spec_file}': #{$!.message}")
182
- @parse_errors<<{:filename=>filename,:error=>$!.message}
163
+ def parse_specification spec_identifier
164
+ spec=nil
165
+ begin
166
+ @parsed_files<<spec_identifier
167
+ @parsed_files.uniq!
168
+ spec=@parser.parse_specification(spec_identifier)
169
+ if @specifications[spec.name]
170
+ msg="Duplicate specification name '#{spec.name}' in '#{spec_identifier}'"
171
+ @logger.error(msg)
172
+ @parse_errors<<{:filename=>spec_identifier,:error=>msg}
173
+ @test_states[spec.name]=Patir::CommandSequenceStatus.new(spec.name,[])
174
+ else
175
+ @specifications[spec.name]=spec
176
+ @test_states[spec.name]=Patir::CommandSequenceStatus.new(spec.name,spec.scenario.steps)
183
177
  end
184
- else
185
- msg="'#{filename}' not found."
186
- @logger.error(msg)
187
- @parse_errors<<{:filename=>filename,:error=>msg}
178
+ rescue ParserError
179
+ @logger.error("Error parsing '#{spec_identifier}': #{$!.message}")
180
+ @parse_errors<<{:filename=>spec_identifier,:error=>$!.message}
188
181
  end
189
182
  return spec
190
183
  end
@@ -283,12 +276,7 @@ module Rutema
283
276
  when "unattended"
284
277
  @mode=:unattended
285
278
  else
286
- if File.exists?(command)
287
- @mode=File.expand_path(command)
288
- else
289
- $stderr.puts "Can't find '#{command}' and it does not match any known commands. Don't know what to do with it."
290
- raise "Can't find '#{command}' and it does not match any known commands. Don't know what to do with it."
291
- end
279
+ @mode=command
292
280
  end
293
281
  end
294
282
  end
@@ -0,0 +1,7 @@
1
+ require 'rutema/parsers/xml'
2
+ configuration.parser={:class=>Rutema::MinimalXMLParser}
3
+ configuration.tests=[
4
+ "../specs/T001.spec",
5
+ "22345",
6
+ "../specs/T003.spec",
7
+ ]
@@ -34,8 +34,12 @@ module TestRutema
34
34
  end
35
35
 
36
36
  def test_specification_paths
37
- cfg=Rutema::RutemaConfigurator.new("distro_test/config/full.rutema").configuration
37
+ cfg=Rutema::RutemaConfigurator.new("distro_test/config/test_identifiers.rutema").configuration
38
38
  assert_not_nil(cfg.tests)
39
+ assert(File.exists?(cfg.tests[0]))
40
+ assert(File.exists?(cfg.tests[2]))
41
+ assert(cfg.tests.include?('22345'))
39
42
  end
43
+
40
44
  end
41
45
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rutema
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 1
10
- version: 1.2.1
9
+ - 2
10
+ version: 1.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Vassilis Rizopoulos
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-04 00:00:00 +03:00
18
+ date: 2011-04-05 00:00:00 +03:00
19
19
  default_executable: rutema
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -195,6 +195,7 @@ files:
195
195
  - test/distro_test/config/database.rutema
196
196
  - test/distro_test/config/full.rutema
197
197
  - test/distro_test/config/minimal.rutema
198
+ - test/distro_test/config/test_identifiers.rutema
198
199
  - test/distro_test/specs/check.spec
199
200
  - test/distro_test/specs/duplicate_name.spec
200
201
  - test/distro_test/specs/fail.spec