ZenTest 4.6.0 → 4.6.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,11 @@
1
+ === 4.6.1 / 2011-08-11
2
+
3
+ * 3 bug fixes:
4
+
5
+ * Fix for option flags and unhandled error warning in autotest. (dbackeus)
6
+ * Fix option w/ args handling and restart by storing ARGV in options[:args]
7
+ * Fixed autotest --rc option handling. (simplybusiness)
8
+
1
9
  === 4.6.0 / 2011-07-22
2
10
 
3
11
  * 6 minor enhancements:
data/Rakefile CHANGED
@@ -12,6 +12,8 @@ Hoe.plugin :seattlerb
12
12
  Hoe.spec "ZenTest" do
13
13
  developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
14
14
  developer 'Eric Hodel', 'drbrain@segment7.net'
15
+
16
+ require_rubygems_version "~> 1.8"
15
17
  end
16
18
 
17
19
  desc "run autotest on itself"
@@ -84,7 +84,10 @@ class Autotest
84
84
 
85
85
  def self.parse_options args = ARGV
86
86
  require 'optparse'
87
- options = {}
87
+ options = {
88
+ :args => args.dup
89
+ }
90
+
88
91
  OptionParser.new do |opts|
89
92
  opts.banner = <<-BANNER.gsub(/^ /, '')
90
93
  Continuous testing for your ruby app.
@@ -118,7 +121,7 @@ class Autotest
118
121
  end
119
122
 
120
123
  opts.on("-r", "--rc CONF", String, "Override path to config file") do |o|
121
- options[:rc] = o
124
+ options[:rc] = Array(o)
122
125
  end
123
126
 
124
127
  opts.on("-s", "--style STYLE", String,
@@ -134,7 +137,7 @@ class Autotest
134
137
  puts opts
135
138
  exit 1
136
139
  end
137
- end.parse args
140
+ end.parse! args
138
141
 
139
142
  Autotest.options.merge! options
140
143
 
@@ -289,7 +292,8 @@ class Autotest
289
292
  self.prefix = nil
290
293
  self.sleep = 1
291
294
  self.testlib = "test/unit"
292
- self.find_directories = ARGV.empty? ? ['.'] : ARGV.dup
295
+ specified_directories = ARGV.reject { |arg| arg.start_with?("-") } # options are not directories
296
+ self.find_directories = specified_directories.empty? ? ['.'] : specified_directories
293
297
  self.unit_diff = nil
294
298
  self.latest_results = nil
295
299
 
@@ -437,7 +441,7 @@ class Autotest
437
441
  def restart
438
442
  Process.kill "KILL", @child if @child
439
443
 
440
- cmd = [$0, *ARGV]
444
+ cmd = [$0, *options[:args]]
441
445
 
442
446
  index = $LOAD_PATH.index RbConfig::CONFIG["sitelibdir"]
443
447
 
@@ -840,8 +844,7 @@ class Autotest
840
844
  HOOKS[name] << block
841
845
  end
842
846
 
843
- add_hook :died do |at, args|
844
- err = *args
847
+ add_hook :died do |at, err|
845
848
  warn "Unhandled exception: #{err}"
846
849
  warn err.backtrace.join("\n ")
847
850
  warn "Quitting"
@@ -1,6 +1,12 @@
1
1
  module Autotest::Restart
2
+ Autotest.add_hook :initialize do |at|
3
+ configs = [File.expand_path('~/.autotest'), './.autotest']
4
+ at.extra_files.concat configs
5
+ false
6
+ end
7
+
2
8
  Autotest.add_hook :updated do |at, *args|
3
- if args.flatten.include? ".autotest" then
9
+ unless args.flatten.grep(/\.autotest$/).empty? then
4
10
  warn "Detected change to .autotest, restarting"
5
11
  at.restart
6
12
  end
@@ -57,7 +57,7 @@ end
57
57
 
58
58
  class ZenTest
59
59
 
60
- VERSION = '4.6.0'
60
+ VERSION = '4.6.1'
61
61
 
62
62
  include ZenTestMapping
63
63
 
@@ -24,6 +24,10 @@ class Autotest
24
24
  def self.clear_hooks
25
25
  HOOKS.clear
26
26
  end
27
+
28
+ def self.reset_options
29
+ @@options = {}
30
+ end
27
31
  end
28
32
 
29
33
  class TestAutotest < MiniTest::Unit::TestCase
@@ -465,6 +469,17 @@ test_error2(#{@test_class}):
465
469
  assert_match @a.testlib, @a.make_test_cmd(f)
466
470
  end
467
471
 
472
+ def test_runner_accepts_rc_options
473
+ begin
474
+ Autotest.parse_options(['--rc', 'autotest_rc'])
475
+ Autotest.new
476
+ rescue
477
+ deny $!, "It should not throw #{$!.message}"
478
+ ensure
479
+ Autotest.reset_options
480
+ end
481
+ end
482
+
468
483
  def util_exceptions
469
484
  @a.exception_list.sort_by { |r| r.to_s }
470
485
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZenTest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 39
4
+ hash: 37
5
5
  prerelease:
6
6
  segments:
7
7
  - 4
8
8
  - 6
9
- - 0
10
- version: 4.6.0
9
+ - 1
10
+ version: 4.6.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -37,7 +37,7 @@ cert_chain:
37
37
  FBHgymkyj/AOSqKRIpXPhjC6
38
38
  -----END CERTIFICATE-----
39
39
 
40
- date: 2011-07-23 00:00:00 Z
40
+ date: 2011-08-12 00:00:00 Z
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: minitest
@@ -47,11 +47,11 @@ dependencies:
47
47
  requirements:
48
48
  - - ~>
49
49
  - !ruby/object:Gem::Version
50
- hash: 5
50
+ hash: 11
51
51
  segments:
52
52
  - 2
53
- - 3
54
- version: "2.3"
53
+ - 4
54
+ version: "2.4"
55
55
  type: :development
56
56
  version_requirements: *id001
57
57
  - !ruby/object:Gem::Dependency
@@ -169,16 +169,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
169
169
  required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  none: false
171
171
  requirements:
172
- - - ">="
172
+ - - ~>
173
173
  - !ruby/object:Gem::Version
174
- hash: 3
174
+ hash: 31
175
175
  segments:
176
- - 0
177
- version: "0"
176
+ - 1
177
+ - 8
178
+ version: "1.8"
178
179
  requirements: []
179
180
 
180
181
  rubyforge_project: zentest
181
- rubygems_version: 1.8.2
182
+ rubygems_version: 1.8.5
182
183
  signing_key:
183
184
  specification_version: 3
184
185
  summary: "ZenTest provides 4 different tools: zentest, unit_diff, autotest, and multiruby"
metadata.gz.sig CHANGED
Binary file