autotest-standalone 4.5.9 → 4.5.10

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.md CHANGED
@@ -21,8 +21,11 @@ Install
21
21
  sudo gem install autotest-standalone
22
22
 
23
23
  Optional: [Autotest for Test::Unit on Rails](https://github.com/grosser/autotest-rails)
24
+
24
25
  sudo gem install autotest-rails-pure
26
+
25
27
  Optional: [ZenTest without Autotest](http://github.com/grosser/zentest) version:
28
+
26
29
  sudo gem install zentest-without-autotest
27
30
 
28
31
 
@@ -40,6 +43,7 @@ Usage
40
43
  -r, --rc CONFIG Path to config file. (Defaults to ~/.autotest or current_dir/.autotest)
41
44
  -s, --style STYLE Which style to use, e.g. rspec, rspec2
42
45
  -b, --bundle-exec Use bundle exec to run tests
46
+ -d, --delay SECONDS Delay time from file change to test run
43
47
  -n, --notify Notify about success and failure via popups
44
48
  -h, --help Show this.
45
49
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.5.9
1
+ 4.5.10
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "autotest-standalone"
8
- s.version = "4.5.9"
8
+ s.version = "4.5.10"
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", "Michael Grosser"]
12
- s.date = "2011-12-15"
12
+ s.date = "2012-10-16"
13
13
  s.executables = ["autotest", "unit_diff"]
14
14
  s.files = [
15
15
  ".autotest",
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
40
40
  ]
41
41
  s.homepage = "http://github.com/grosser/autotest"
42
42
  s.require_paths = ["lib"]
43
- s.rubygems_version = "1.8.10"
43
+ s.rubygems_version = "1.8.24"
44
44
  s.summary = "Autotest, without ZenTest"
45
45
 
46
46
  if s.respond_to? :specification_version then
@@ -141,6 +141,11 @@ class Autotest
141
141
  require 'autotest/notify'
142
142
  end
143
143
 
144
+ # set to 0 with autotest-fsevent to make autotest react like guard
145
+ opts.on("-d", "--delay DELAY", Integer, "Delay time from file change to test run") do |delay|
146
+ options[:delay] = delay
147
+ end
148
+
144
149
  opts.on "-h", "--help", "Show this." do
145
150
  puts opts
146
151
  exit 1
@@ -281,7 +286,7 @@ class Autotest
281
286
  self.order = :random
282
287
  self.output = $stderr
283
288
  self.prefix = nil
284
- self.sleep = 1
289
+ self.sleep = options[:delay] || 1
285
290
  self.testlib = "test/unit"
286
291
  self.find_directories = ['.']
287
292
  self.unit_diff = "ruby #{File.expand_path("#{File.dirname(__FILE__)}/../bin/unit_diff")} -u" # add ruby to also work for windows
@@ -453,6 +453,16 @@ test_error2(#{@test_class}):
453
453
  assert_equal expect, actual
454
454
  end
455
455
 
456
+ def test_sleep_option
457
+ result = Autotest.parse_options(['--delay','0'])
458
+ assert_equal({:delay => 0}, result)
459
+ end
460
+
461
+ def test_no_options
462
+ result = Autotest.parse_options([])
463
+ assert_equal({}, result)
464
+ end
465
+
456
466
  def test_test_files_for
457
467
  assert_equal [@test], @a.test_files_for(@impl)
458
468
  assert_equal [@test], @a.test_files_for(@test)
@@ -10,7 +10,7 @@ class TestAutotestIntegration < Test::Unit::TestCase
10
10
  def autotest_executable
11
11
  '../../bin/autotest'
12
12
  end
13
-
13
+
14
14
  def run_autotest(flag_string='')
15
15
  `cd #{temp_dir} && #{autotest_executable} #{flag_string}`
16
16
  end
@@ -19,7 +19,7 @@ class TestAutotestIntegration < Test::Unit::TestCase
19
19
  file = "#{temp_dir}/#{file}"
20
20
  dir = File.dirname(file)
21
21
  `mkdir -p #{dir}` unless File.directory?(dir)
22
- File.open(file, 'w'){|f| f.write text }
22
+ File.open(file, 'w'){|f| f.write text }
23
23
  end
24
24
 
25
25
  def write_passing_tests times
@@ -90,6 +90,13 @@ class TestAutotestIntegration < Test::Unit::TestCase
90
90
  assert_match %r{YES}, result
91
91
  assert_match %r{YEP}, result
92
92
  end
93
+
94
+ should 'use a sleep option from .autotest' do
95
+ # speed up autotest to react instantly on save like Guard
96
+ run_autotest("--delay 0")
97
+ a = Autotest.new
98
+ assert_equal a.sleep, 0
99
+ end
93
100
  end
94
101
  end
95
102
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autotest-standalone
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.9
4
+ version: 4.5.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-12-15 00:00:00.000000000 Z
13
+ date: 2012-10-16 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description:
16
16
  email:
@@ -59,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
59
  version: '0'
60
60
  segments:
61
61
  - 0
62
- hash: -115154609
62
+ hash: -2388941284239321268
63
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  requirements: []
70
70
  rubyforge_project:
71
- rubygems_version: 1.8.10
71
+ rubygems_version: 1.8.24
72
72
  signing_key:
73
73
  specification_version: 3
74
74
  summary: Autotest, without ZenTest