rutema 2.0.0.pre12 → 2.0.0.pre13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 768485a85a50179b2444030ade167affbd6b6087
4
- data.tar.gz: 8300238200d066164e54525b3fd8ac5767426c38
3
+ metadata.gz: d03b39f53bd09ff213e24af85abece9d729be911
4
+ data.tar.gz: fc017df49477b0f267dc544e18116605c7fb6291
5
5
  SHA512:
6
- metadata.gz: cba8d6ca533c793b1ebfd2aa3473aedc51839a0b299ac1bb1eaa06a78bb4f6aed57156f0d6e3a38a48a2cc99ef475a5c3c931d646d06ea10b690731e6ff0a940
7
- data.tar.gz: 40325c76ea7dca1e9ddb8a91fd74ae02e2f765f0de8323945f57cee43db608d81194db9aa15bcbc9b000d2ec35f7ac950df94b2c598c59f1d770ff0e978a0103
6
+ metadata.gz: 11c77f71efc98b3b4a989702df73450988b560d8de4409f748b1134ffa20783bb1b47c5506d54deadef72a2c58a6c8977ca442edb8984b3aa5dbddd64874b67a
7
+ data.tar.gz: 3b49add79d0e2fa3665a0416fd7f6fea95f6c64e775a00284e3cfd2742b47895896a12e0fb1772c9f81fa5e2a16ba7fbc5c56236f0efe358e339aaa4b4728800
@@ -1,3 +1,6 @@
1
+ == 2.0.0.pre13 /2016-09-13
2
+ * Introduced suite_teardown and aliased check to suite_setup
3
+ * Added strict_mode to example XML parser
1
4
  == 2.0.0.pre12 /2016-04-14
2
5
  * Fixed crash when test name was nil in all reporters
3
6
  == 2.0.0.pre11 /2016-04-14
@@ -24,7 +24,7 @@ module Rutema
24
24
  opt.on("rutema v#{Version::STRING}")
25
25
  opt.on("Options:")
26
26
  opt.on("--config FILE", "-c FILE",String,"Loads the configuration from FILE") { |config_file| @config_file=config_file}
27
- opt.on("--check","Runs just the check test"){@check=true}
27
+ opt.on("--check","Runs just the suite setup test"){@check=true}
28
28
  #opt.on("--step","Runs test cases step by step"){@step=true}
29
29
  opt.on("--silent","Suppresses console output (only for the default reporters)") { @silent=true}
30
30
  opt.on("--bare","No default reporters whatsoever") { @bare=true}
@@ -47,11 +47,11 @@ module Rutema
47
47
  end
48
48
  def application_flow
49
49
  if @check
50
- #run just the check test
51
- if @configuration.check
52
- exit @engine.run(@configuration.check)
50
+ #run just the suite setup test
51
+ if @configuration.suite_setup
52
+ exit @engine.run(@configuration.suite_setup)
53
53
  else
54
- raise Rutema::RutemaError,"There is no check test defined in the configuration."
54
+ raise Rutema::RutemaError,"There is no suite setup test defined in the configuration."
55
55
  end
56
56
  else
57
57
  #run everything
@@ -14,7 +14,7 @@
14
14
  # configuration.parser={:class=>Rutema::MinimalXMLParser}
15
15
  # configuration.tests=FileList['all/of/the/tests/**/*.*']
16
16
  module ConfigurationDirectives
17
- attr_reader :parser,:runner,:tools,:paths,:tests,:context,:check,:setup,:teardown
17
+ attr_reader :parser,:runner,:tools,:paths,:tests,:context,:setup,:teardown,:suite_setup,:suite_teardown
18
18
  attr_accessor :reporters
19
19
  #Adds a hash of values to the tools hash of the configuration
20
20
  #
@@ -62,15 +62,27 @@
62
62
  @teardown=check_path(path)
63
63
  end
64
64
 
65
- #Path to the check specification. (optional)
65
+ #Path to the suite setup specification. (optional)
66
66
  #
67
- #The check test runs once in the beginning before all the tests.
67
+ #The suite setup test runs once in the beginning of a test run before all the tests.
68
68
  #
69
69
  #If it fails no tests are run.
70
- def check= path
71
- @check=check_path(path)
70
+ #
71
+ #This is also aliased as check= for backwards compatibility
72
+ def suite_setup= path
73
+ @suite_setup=check_path(path)
72
74
  end
75
+
76
+ alias_method :check,:suite_setup
77
+ alias_method :check=,:suite_setup=
73
78
 
79
+ #Path to the suite teardown specification. (optional)
80
+ #
81
+ #The suite teardown test runs after all the tests.
82
+ def suite_teardown= path
83
+ @suite_teardown=check_path(path)
84
+ end
85
+
74
86
  #Hash values for passing data to the system. It's supposed to be used in the reporters and contain
75
87
  #values such as version numbers, tester names etc.
76
88
  def context= definition
@@ -28,10 +28,10 @@ module Rutema
28
28
  @dispatcher.run!
29
29
  #start
30
30
  message("start")
31
- check,setup,teardown,tests=*parse(test_identifier)
31
+ suite_setup,suite_teardown,setup,teardown,tests=*parse(test_identifier)
32
32
  if tests.empty?
33
- if is_special?(test_identifier)
34
- run_scenarios([check],nil)
33
+ if test_identifier && is_special?(test_identifier)
34
+ run_scenarios([suite_setup],nil)
35
35
  else
36
36
  @dispatcher.exit
37
37
  raise RutemaError,"Did not parse any tests succesfully"
@@ -41,7 +41,7 @@ module Rutema
41
41
  @runner.teardown=teardown
42
42
  #running - at this point we've done any and all checks and we're stepping on the gas
43
43
  message("running")
44
- run_scenarios(tests,check)
44
+ run_scenarios(tests,suite_setup,suite_teardown)
45
45
  end
46
46
  message("end")
47
47
  @dispatcher.exit
@@ -62,8 +62,8 @@ module Rutema
62
62
  specs=parse_specifications(@configuration.tests)
63
63
  end
64
64
  specs.compact!
65
- check,setup,teardown=parse_specials(@configuration)
66
- return [check,setup,teardown,specs]
65
+ suite_setup,suite_teardown,setup,teardown=parse_specials(@configuration)
66
+ return [suite_setup,suite_teardown,setup,teardown,specs]
67
67
  end
68
68
  private
69
69
  def parse_specifications tests
@@ -79,11 +79,15 @@ module Rutema
79
79
  end
80
80
  end
81
81
  def parse_specials configuration
82
- check=nil
82
+ suite_setup=nil
83
+ suite_teardown=nil
83
84
  setup=nil
84
85
  teardown=nil
85
- if configuration.check
86
- check=parse_specification(configuration.check)
86
+ if configuration.suite_setup
87
+ suite_setup=parse_specification(configuration.suite_setup)
88
+ end
89
+ if configuration.suite_teardown
90
+ suite_teardown=parse_specification(configuration.suite_teardown)
87
91
  end
88
92
  if configuration.setup
89
93
  setup=parse_specification(configuration.setup)
@@ -91,21 +95,24 @@ module Rutema
91
95
  if configuration.teardown
92
96
  teardown=parse_specification(configuration.teardown)
93
97
  end
94
- return check,setup,teardown
98
+ return suite_setup,suite_teardown,setup,teardown
95
99
  end
96
- def run_scenarios specs,check
100
+ def run_scenarios specs,suite_setup,suite_teardown
97
101
  if specs.empty?
98
102
  error(nil,"No tests to run")
99
103
  else
100
- if check
101
- if run_test(check)==:success
104
+ if suite_setup
105
+ if run_test(suite_setup)==:success
102
106
  specs.each{|s| run_test(s)}
103
107
  else
104
- error(nil,"Check test failed")
108
+ error(nil,"Suite setup test failed")
105
109
  end
106
110
  else
107
111
  specs.each{|spec| run_test(spec)}
108
112
  end
113
+ if suite_teardown
114
+ run_test(suite_teardown)
115
+ end
109
116
  end
110
117
  end
111
118
  def run_test specification
@@ -130,7 +137,8 @@ module Rutema
130
137
  end
131
138
  def is_special? test_identifier
132
139
  full_path=File.expand_path(test_identifier)
133
- return full_path==@configuration.check ||
140
+ return full_path==@configuration.suite_setup ||
141
+ full_path==@configuration.suite_teardown ||
134
142
  full_path==@configuration.setup ||
135
143
  full_path==@configuration.teardown
136
144
  end
@@ -145,8 +145,10 @@ module Rutema
145
145
  self.send(:"element_#{step.step_type}",step)
146
146
  rescue
147
147
  raise ParserError, $!.message
148
- end
149
- end#begin
148
+ end#begin
149
+ elsif @configuration.parser["strict_mode"]
150
+ raise ParserError,"No command element associated with #{step.step_type}. Missing element_#{step.step_type}"
151
+ end
150
152
  end#each
151
153
  end#chdir
152
154
  return spec
@@ -3,7 +3,7 @@ module Rutema
3
3
  module Version
4
4
  MAJOR=2
5
5
  MINOR=0
6
- TINY="0.pre12"
6
+ TINY="0.pre13"
7
7
  STRING=[ MAJOR, MINOR, TINY ].join( "." )
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rutema
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre12
4
+ version: 2.0.0.pre13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vassilis Rizopoulos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-14 00:00:00.000000000 Z
11
+ date: 2016-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: patir
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.14'
61
+ version: '3.15'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.14'
68
+ version: '3.15'
69
69
  description: "rutema [http://github.com/damphyr/rutema](http://github.com/damphyr/rutema)\n\nrutema
70
70
  is a test execution tool and a framework for organizing and managing test execution
71
71
  across different tools.\n\nIt enables the combination of different test tools while