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.
- data/Manifest.txt +1 -0
- data/lib/rutema/configuration.rb +1 -1
- data/lib/rutema/system.rb +19 -31
- data/test/distro_test/config/test_identifiers.rutema +7 -0
- data/test/test_configuration.rb +5 -1
- metadata +5 -4
data/Manifest.txt
CHANGED
@@ -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
|
data/lib/rutema/configuration.rb
CHANGED
data/lib/rutema/system.rb
CHANGED
@@ -22,7 +22,7 @@ module Rutema
|
|
22
22
|
module Version
|
23
23
|
MAJOR=1
|
24
24
|
MINOR=2
|
25
|
-
TINY=
|
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
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
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
|
-
|
185
|
-
|
186
|
-
@
|
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
|
-
|
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
|
data/test/test_configuration.rb
CHANGED
@@ -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/
|
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
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-
|
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
|