ZenTest 4.1.4 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -1,3 +1,17 @@
1
+ === 4.2.0 / 2009-12-08
2
+
3
+ * 3 minor enhancements:
4
+
5
+ * Added 'multiruby -1 $version' for easier execution (idea from flori)
6
+ * Set up and tear down PATH in multiruby (luis)
7
+ * died hook now gets passed the exception (amikula)
8
+
9
+ * 3 bug fixes:
10
+
11
+ * Deal with windoze getc returning nil (undees)
12
+ * Fix unit_diff for multiline miniunit results.
13
+ * Fix warning for 1.8.8+
14
+
1
15
  === 4.1.4 / 2009-08-07
2
16
 
3
17
  * 2 minor enhancements:
@@ -3,6 +3,23 @@
3
3
  require 'multiruby'
4
4
 
5
5
  root_dir = Multiruby.root_dir
6
+
7
+ ##
8
+ # multiruby -1 1.8.7 ruby_args...
9
+
10
+ if ARGV.first == "-1" then
11
+ ARGV.shift
12
+ vers = Dir["#{root_dir}/install/#{ARGV.shift}*"]
13
+
14
+ abort "ambiguous version: #{vers.map { |p| File.basename p }.inspect}" if
15
+ vers.size != 1
16
+
17
+ bin = "#{vers.first}/bin"
18
+ ENV['PATH'] += File::PATH_SEPARATOR + bin
19
+
20
+ exec "#{bin}/ruby", *ARGV
21
+ end
22
+
6
23
  versions = Multiruby.build_and_install
7
24
  versions = ENV['VERSIONS'].split(/:/) if ENV.has_key? 'VERSIONS'
8
25
 
@@ -11,6 +28,9 @@ if ENV.has_key? 'EXCLUDED_VERSIONS' then
11
28
  versions = versions.delete_if { |v| v =~ excludes }
12
29
  end
13
30
 
31
+ # safekeep original PATH
32
+ original_path = ENV['PATH']
33
+
14
34
  results = {}
15
35
  versions.each do |version|
16
36
  ruby = "#{root_dir}/install/#{version}/bin/ruby"
@@ -23,10 +43,17 @@ versions.each do |version|
23
43
  cmd.sub!(/#{ENV['HOME']}/, '~')
24
44
  puts "CMD = #{cmd}"
25
45
  puts
46
+
47
+ # append ruby binary path prior execution
48
+ ENV['PATH'] += File::PATH_SEPARATOR + "#{dir}/bin"
49
+
26
50
  system ruby, *ARGV
27
51
  puts
28
52
  puts "RESULT = #{$?}"
29
53
  results[version] = $?
54
+
55
+ # restore the path to original state
56
+ ENV['PATH'] = original_path
30
57
  end
31
58
 
32
59
  passed, failed = results.keys.partition { |v| results[v] == 0 }
@@ -162,7 +162,7 @@ class Autotest
162
162
  self.order = :random
163
163
  self.output = $stderr
164
164
  self.sleep = 1
165
- self.testlib = "test/unit"
165
+ self.testlib = "test/unit"
166
166
  self.find_directories = ['.']
167
167
  self.unit_diff = "unit_diff -u"
168
168
 
@@ -206,8 +206,8 @@ class Autotest
206
206
  end
207
207
  end
208
208
  hook :quit
209
- rescue Exception
210
- hook :died
209
+ rescue Exception => err
210
+ hook :died, err
211
211
  end
212
212
 
213
213
  ##
@@ -242,7 +242,7 @@ class Autotest
242
242
  begin
243
243
  open("| #{cmd}", "r") do |f|
244
244
  until f.eof? do
245
- c = f.getc
245
+ c = f.getc or break
246
246
  putc c
247
247
  line << c
248
248
  if c == ?\n then
@@ -499,7 +499,7 @@ class Autotest
499
499
 
500
500
  p :test_file_for => [filename, result.first] if result and $DEBUG
501
501
 
502
- result = result.nil? ? [] : Array(result.last.call(filename, $~))
502
+ result = result.nil? ? [] : [result.last.call(filename, $~)].flatten
503
503
 
504
504
  output.puts "No tests matched #{filename}" if
505
505
  ($v or $TESTING) and result.empty?
@@ -81,7 +81,7 @@ class UnitDiff
81
81
  end
82
82
  output.puts input.gets # the rest of "Finished in..."
83
83
  output.puts
84
- next
84
+ next
85
85
  when /^\s*$/, /^\(?\s*\d+\) (Failure|Error):/, /^\d+\)/ then
86
86
  print_lines = false
87
87
  current = []
@@ -96,6 +96,22 @@ class UnitDiff
96
96
  data = data.reject { |o| o == ["\n"] or o.empty? }
97
97
  footer = data.pop
98
98
 
99
+ data.map do |result|
100
+ break if result.find do |line|
101
+ line =~ / expected( but was|, not)/
102
+ end
103
+
104
+ header = result.find do |line|
105
+ line =~ /^\(?\s*\d+\) (Failure|Error):/
106
+ end
107
+
108
+ break unless header
109
+
110
+ message_index = result.index(header) + 2
111
+
112
+ result[message_index..-1] = result[message_index..-1].join
113
+ end
114
+
99
115
  return data, footer
100
116
  end
101
117
 
@@ -53,7 +53,7 @@ end
53
53
 
54
54
  class ZenTest
55
55
 
56
- VERSION = '4.1.4'
56
+ VERSION = '4.2.0'
57
57
 
58
58
  include ZenTestMapping
59
59
 
@@ -44,6 +44,27 @@ Expected ['a', 'b', 'c'], not ['a', 'c', 'b'].
44
44
  util_unit_diff(header, input, expected, :parse_input)
45
45
  end
46
46
 
47
+ def test_input_miniunit_multiline
48
+ header = "Loaded suite -e\nStarted\nF\nFinished in 0.035332 seconds.\n\n"
49
+ input = "#{header} 1) Failure:
50
+ test_blah(TestBlah) [./blah.rb:25]:
51
+ Expected ['a',
52
+ 'b',
53
+ 'c'], not ['a',
54
+ 'c',
55
+ 'b'].
56
+
57
+ 1 tests, 1 assertions, 1 failures, 0 errors
58
+ "
59
+
60
+ expected = [[[" 1) Failure:\n",
61
+ "test_blah(TestBlah) [./blah.rb:25]:\n",
62
+ "Expected ['a',\n 'b',\n 'c'], not ['a',\n 'c',\n 'b'].\n"]],
63
+ ["\n", "1 tests, 1 assertions, 1 failures, 0 errors\n"]]
64
+
65
+ util_unit_diff(header, input, expected, :parse_input)
66
+ end
67
+
47
68
  def test_input_mspec
48
69
  header = <<-HEADER
49
70
  Started
@@ -169,6 +190,7 @@ backtrace = <<-BACKTRACE
169
190
 
170
191
  assert_equal expected, @diff.parse_diff(input)
171
192
  end
193
+
172
194
  def test_parse_diff1
173
195
  input = [" 1) Failure:\n",
174
196
  "test_test1(TestBlah) [./blah.rb:25]:\n",
metadata CHANGED
@@ -1,16 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZenTest
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.4
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
8
8
  - Eric Hodel
9
9
  autorequire:
10
10
  bindir: bin
11
- cert_chain: []
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
15
+ ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
16
+ GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
17
+ AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
18
+ JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
19
+ b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
20
+ taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
21
+ oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
22
+ GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
23
+ qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
24
+ gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
25
+ HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
26
+ AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
27
+ vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
28
+ w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
29
+ l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
30
+ n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
31
+ FBHgymkyj/AOSqKRIpXPhjC6
32
+ -----END CERTIFICATE-----
12
33
 
13
- date: 2009-08-07 00:00:00 -07:00
34
+ date: 2009-12-08 00:00:00 -08:00
14
35
  default_executable:
15
36
  dependencies:
16
37
  - !ruby/object:Gem::Dependency
@@ -21,7 +42,7 @@ dependencies:
21
42
  requirements:
22
43
  - - ">="
23
44
  - !ruby/object:Gem::Version
24
- version: 2.3.3
45
+ version: 2.4.0
25
46
  version:
26
47
  description: |-
27
48
  ZenTest provides 4 different tools: zentest, unit_diff, autotest, and
Binary file