autotest 4.3.2 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,26 @@
1
+ === 4.4.0 / 2010-09-01
2
+
3
+ * 1 major enhancement:
4
+
5
+ * Removed git building. I'm dropping direct support for rubinius.
6
+
7
+ * 3 minor enhancements:
8
+
9
+ * Added multiruby mri:list:x.y.z command so you can see what's available.
10
+ * Enabled installing specific patch versions of ruby.
11
+ * multiruby rubygems:update now forces a build to be less confusing.
12
+
13
+ * 1 bug fix:
14
+
15
+ * Removed redundant test_to_normal, now in zentest_mappings
16
+
17
+ === 4.3.3 / 2010-06-17
18
+
19
+ * 2 minor enhancements:
20
+
21
+ * Added options and removed pattern from Autotest::RCov
22
+ * update_rubygems now deletes cached rubygems installs
23
+
1
24
  === 4.3.2 / 2010-06-02
2
25
 
3
26
  * 1 minor enhancement:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.3.2
1
+ 4.4.0
data/autotest.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{autotest}
8
- s.version = "4.3.2"
8
+ s.version = "4.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ryan Davis"]
12
- s.date = %q{2010-06-06}
12
+ s.date = %q{2010-09-29}
13
13
  s.executables = ["autotest", "unit_diff"]
14
14
  s.extra_rdoc_files = [
15
15
  "README.markdown"
data/bin/autotest CHANGED
@@ -5,7 +5,7 @@ require 'optparse'
5
5
  options = {}
6
6
  OptionParser.new do |opts|
7
7
  opts.banner = <<BANNER
8
- Continuouse testing for your ruby app.
8
+ Continuous testing for your ruby app.
9
9
 
10
10
  Usage:
11
11
  autotest [options]
@@ -20,7 +20,7 @@ BANNER
20
20
  opts.on("-h", "--help","Show this.") { puts opts;exit }
21
21
  end.parse!
22
22
 
23
- #TODO remove this ? what does it do ?
23
+ # remove warnings from Dir.[]
24
24
  class Dir
25
25
  class << self
26
26
  alias :old_index :[]
@@ -34,12 +34,13 @@ class Dir
34
34
  end
35
35
 
36
36
  #run the correct Autotest variant fitting to the local structure
37
- $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib")
38
-
37
+ $LOAD_PATH.unshift(File.expand_path("#{File.dirname(__FILE__)}/../lib"))
39
38
  require 'autotest'
39
+
40
40
  Autotest.options.merge!(options)
41
41
  target = Autotest
42
42
  style = Autotest.autodiscover
43
+
43
44
  unless style.empty? then
44
45
  mod = "autotest/#{style.join("_")}"
45
46
  puts "loading #{mod}" unless options[:quiet]
data/lib/autotest.rb CHANGED
@@ -80,6 +80,45 @@ class Autotest
80
80
 
81
81
  @@discoveries = []
82
82
 
83
+ ##
84
+ # Provide some help
85
+ def self.usage
86
+ help = [
87
+ "autotest [options]",
88
+ nil,
89
+ "Autotest automatically tests code that has changed.",
90
+ "It assumes the code is in lib, and tests are in tests.",
91
+ "Autotest uses plugins to control what happens.",
92
+ "You configure plugins with require statements in the",
93
+ ".autotest file in your project base directory,",
94
+ "and a default configuration for all your projects",
95
+ "in the .autotest file in your home directory.",
96
+
97
+ nil,
98
+ "options:",
99
+ "\t-h",
100
+ "\t-help\t\tYou're looking at it.",
101
+ nil,
102
+ "\t-v\t\tBe verbose.",
103
+ "\t\t\tPrints files that autotest doesn't know how to map to",
104
+ "\t\t\ttests.",
105
+ nil,
106
+ "\t-q\t\tBe more quiet.",
107
+ nil,
108
+ "\t-f\t\tFast start.",
109
+ "\t\t\tDoesn't initially run tests at start.",
110
+ ]
111
+ STDERR.puts help.join("\n")
112
+ end
113
+
114
+ ##
115
+ # Call Autotest.usage then exit with 1.
116
+ def self.usage_with_exit
117
+ self.usage
118
+ exit 1
119
+ end
120
+
121
+
83
122
  ##
84
123
  # Add a proc to the collection of discovery procs. See
85
124
  # +autodiscover+.
@@ -157,6 +196,8 @@ class Autotest
157
196
  :unit_diff,
158
197
  :wants_to_quit)
159
198
 
199
+ alias tainted? tainted
200
+
160
201
  ##
161
202
  # Initialize the instance and then load the user's .autotest file, if any.
162
203
 
@@ -223,14 +264,14 @@ class Autotest
223
264
  loop do
224
265
  begin # ^c handler
225
266
  get_to_green
226
- if self.tainted and not options[:no_full_after_failed] then
267
+ if tainted? and not options[:no_full_after_failed]
227
268
  rerun_all_tests
228
269
  else
229
270
  hook :all_good
230
271
  end
231
272
  wait_for_changes
232
273
  rescue Interrupt
233
- break if self.wants_to_quit
274
+ break if wants_to_quit
234
275
  reset
235
276
  end
236
277
  end
data/lib/autotest/rcov.rb CHANGED
@@ -1,16 +1,21 @@
1
1
  module Autotest::RCov
2
- @@command, @@pattern = "rcov", "test/*.rb"
2
+ @@command, @@options = "rcov", nil
3
3
 
4
4
  def self.command= o
5
5
  @@command = o
6
6
  end
7
7
 
8
8
  def self.pattern= o
9
- @@pattern = o
9
+ warn "RCov.pattern= no longer has any functionality. please remove."
10
+ end
11
+
12
+ def self.options= o
13
+ @@options = o
10
14
  end
11
15
 
12
16
  Autotest.add_hook :all_good do |at|
13
- system "rake #{@@command} PATTERN=#{@@pattern}"
17
+ options = @@options ? "RCOVOPTS=\"#{@@options}\"" : ""
18
+ system "rake #{@@command} #{options}"
14
19
  false
15
20
  end
16
21
 
@@ -20,4 +25,3 @@ module Autotest::RCov
20
25
  false
21
26
  end
22
27
  end
23
-
@@ -2,10 +2,11 @@ module Autotest::Restart
2
2
  Autotest.add_hook :updated do |at, *args|
3
3
  if args.flatten.include? ".autotest" then
4
4
  warn "Detected change to .autotest, restarting"
5
- cmd = "autotest"
5
+ cmd = %w(autotest)
6
6
  cmd << " -v" if $v
7
-
8
- exec cmd
7
+ cmd += ARGV
8
+
9
+ exec(*cmd)
9
10
  end
10
11
  end
11
12
  end
@@ -110,7 +110,10 @@ class TestAutotest < Test::Unit::TestCase
110
110
 
111
111
  @a.find_order = @files.keys.sort
112
112
 
113
- input = [['test_fail1', @test_class], ['test_fail2', @test_class], ['test_error1', @test_class], ['test_error2', @test_class]]
113
+ input = [['test_fail1', @test_class],
114
+ ['test_fail2', @test_class],
115
+ ['test_error1', @test_class],
116
+ ['test_error2', @test_class]]
114
117
  result = @a.consolidate_failures input
115
118
  expected = { @test => %w( test_fail1 test_fail2 test_error1 test_error2 ) }
116
119
  assert_equal expected, result
@@ -133,10 +136,10 @@ class TestAutotest < Test::Unit::TestCase
133
136
 
134
137
  def test_consolidate_failures_nested_classes
135
138
  @files.clear
136
- @files['lib/outer.rb'] = Time.at(5)
139
+ @files['lib/outer.rb'] = Time.at(5)
137
140
  @files['lib/outer/inner.rb'] = Time.at(5)
138
- @files[@inner_test] = Time.at(5)
139
- @files[@outer_test] = Time.at(5)
141
+ @files[@inner_test] = Time.at(5)
142
+ @files[@outer_test] = Time.at(5)
140
143
 
141
144
  @a.find_order = @files.keys.sort
142
145
 
@@ -363,9 +366,14 @@ test_error2(#{@test_class}):
363
366
  }
364
367
 
365
368
  unit_diff = File.expand_path("#{File.dirname(__FILE__)}/../bin/unit_diff")
369
+ pre = "#{RUBY} -I.:lib:test -rubygems"
370
+ req = ".each { |f| require f }\""
371
+ post = "| #{unit_diff} -u"
366
372
 
367
- expected = [ "#{RUBY} -I.:lib:test -rubygems -e \"['test/unit', '#{@test}'].each { |f| require f }\" | #{unit_diff} -u",
368
- "#{RUBY} -I.:lib:test -rubygems test/test_fooby.rb -n \"/^(test_something1|test_something2)$/\" | #{unit_diff} -u" ].join("; ")
373
+ expected = [
374
+ "#{pre} -e \"['test/unit', '#{@test}']#{req} #{post}",
375
+ "#{pre} test/test_fooby.rb -n \"/^(test_something1|test_something2)$/\" #{post}"
376
+ ].join("; ")
369
377
 
370
378
  result = @a.make_test_cmd f
371
379
  assert_equal expected, result
@@ -429,8 +437,8 @@ test_error2(#{@test_class}):
429
437
 
430
438
  assert @a.find_files_to_test(files)
431
439
  assert_equal expected, @a.files_to_test
432
- assert_equal t, @a.last_mtime
433
- assert_equal "", @a.output.string
440
+ assert_equal t, @a.last_mtime
441
+ assert_equal "", @a.output.string
434
442
  end
435
443
 
436
444
  def util_mappings
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 4
7
- - 3
8
- - 2
9
- version: 4.3.2
7
+ - 4
8
+ - 0
9
+ version: 4.4.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ryan Davis
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-06 00:00:00 +02:00
17
+ date: 2010-09-29 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20