ZenTest 4.11.0 → 4.12.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,19 +0,0 @@
1
- ##
2
- # Run autotest with isolate support.
3
-
4
- module Autotest::Isolate
5
- @@dir = "tmp/isolate/#{Gem.ruby_engine}-#{RbConfig::CONFIG['ruby_version']}"
6
-
7
- def self.dir= o
8
- @@dir = o
9
- end
10
-
11
- Autotest.add_hook :initialize do |at|
12
- ENV["GEM_HOME"] = @@dir
13
- ENV["GEM_PATH"] = @@dir
14
- ENV["PATH"] += ":#{@@dir}/bin"
15
-
16
- Gem.clear_paths
17
- false
18
- end
19
- end
data/lib/autotest/once.rb DELETED
@@ -1,9 +0,0 @@
1
- ##
2
- # this is for autotest plugin developers only...
3
-
4
- module Autotest::Once
5
- Autotest.add_hook :ran_command do |at|
6
- exit 0
7
- end
8
- end
9
-
@@ -1,56 +0,0 @@
1
- module Autotest::Preload
2
- def self.glob
3
- @glob
4
- end
5
-
6
- def self.glob= o
7
- @glob = o
8
- end
9
-
10
- self.glob = "test/test_helper.rb"
11
-
12
- Autotest.add_hook :post_initialize do |at, *args|
13
- at.add_sigquit_handler
14
-
15
- warn "pre-loading initializers"
16
- t0 = Time.now
17
- Dir[self.glob].each do |path|
18
- require path
19
- end
20
- warn "done pre-loading initializers in %.2f seconds" % [Time.now - t0]
21
-
22
- false
23
- end
24
- end
25
-
26
- class Autotest
27
- alias :old_run_tests :run_tests
28
-
29
- def run_tests
30
- hook :run_command
31
-
32
- new_mtime = self.find_files_to_test
33
- return unless new_mtime
34
- self.last_mtime = new_mtime
35
-
36
- begin
37
- # TODO: deal with unit_diff and partial test runs later
38
- original_argv = ARGV.dup
39
- ARGV.clear
40
-
41
- @child = fork do
42
- trap "QUIT", "DEFAULT"
43
- trap "INT", "DEFAULT"
44
- files_to_test.keys.each do |file|
45
- load file
46
- end
47
- end
48
- Process.wait
49
- ensure
50
- @child = nil
51
- ARGV.replace original_argv
52
- end
53
-
54
- hook :ran_command
55
- end
56
- end
data/lib/autotest/rcov.rb DELETED
@@ -1,27 +0,0 @@
1
- module Autotest::RCov
2
- @@command, @@options = "rcov", nil
3
-
4
- def self.command= o
5
- @@command = o
6
- end
7
-
8
- def self.pattern= o
9
- warn "RCov.pattern= no longer has any functionality. please remove."
10
- end
11
-
12
- def self.options= o
13
- @@options = o
14
- end
15
-
16
- Autotest.add_hook :all_good do |at|
17
- options = @@options ? "RCOVOPTS=\"#{@@options}\"" : ""
18
- system "rake #{@@command} #{options}"
19
- false
20
- end
21
-
22
- Autotest.add_hook :initialize do |at|
23
- at.add_exception 'coverage'
24
- at.add_exception 'coverage.info'
25
- false
26
- end
27
- end
@@ -1,16 +0,0 @@
1
- module Autotest::Restart
2
- Autotest.add_hook :initialize do |at|
3
- configs = [File.expand_path('~/.autotest'), './.autotest'].select { |f|
4
- File.exist? f
5
- }
6
- at.extra_files.concat configs
7
- false
8
- end
9
-
10
- Autotest.add_hook :updated do |at, found|
11
- unless found.flatten.grep(/\.autotest$/).empty? then
12
- warn "Detected change to .autotest, restarting"
13
- at.restart
14
- end
15
- end
16
- end
@@ -1,9 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- module Autotest::Timestamp
4
- Autotest.add_hook :ran_command do
5
- puts
6
- puts "# Finished at #{Time.now.strftime "%Y-%m-%d %H:%M:%S"}"
7
- puts
8
- end
9
- end