minitest-bisect 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67b362eaa2e8e1e19a978058f3e71ff2f70dc99c
4
- data.tar.gz: 9ecb07d739b2fe6ed7d103d41aecd01f2f030f8c
3
+ metadata.gz: b52e433884ec629aed62043f342ebf6f21e1ec65
4
+ data.tar.gz: f90ecba8f0fde0d17d02cc20f3740e01fc005290
5
5
  SHA512:
6
- metadata.gz: cf3b3b231ca91dd0a291a4c461bd5abbffcd46989be1f0bb2d763c36171a545865d7adbaed2445fd8310cc4a988a363a5cc1450b5bfb326a10af847095fa6a66
7
- data.tar.gz: a0d419ca93f933b57f2c9c41ac946bcb617f39d852f7a4d0defa94d1686cb948e22c72318a55210dc9801dcd569fa00fa35901b51cd5380c21097a7945e8bfb7
6
+ metadata.gz: 0cd4cc3115649a5bf7561dee93ee904e12e67beaf23ed45e3f2c095698a7446f8b86af271943c582ab80f7a95a13e50c97aba81b4879eeec22df8bc2a4928a2b
7
+ data.tar.gz: 083bdeab31eab71bcfa7a48842963ea3a4d8103a785b9373eee96ba65e8f0e86d55dad4065b0c40f5843efc6ee1f8ebe0ceb2e9b59e720775fb5e5b176e4d9e4
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,10 @@
1
+ === 1.2.2 / 2015-04-27
2
+
3
+ * 2 bug fixes:
4
+
5
+ * Fixed SHH variable to work with more shell variants. (jeremyevans)
6
+ * Fixed problems with running in jruby. (jeremyevans)
7
+
1
8
  === 1.2.1 / 2014-12-12
2
9
 
3
10
  * 1 bug fix:
data/Rakefile CHANGED
@@ -13,6 +13,7 @@ Hoe.spec "minitest-bisect" do
13
13
  developer "Ryan Davis", "ryand-ruby@zenspider.com"
14
14
  license "MIT"
15
15
 
16
+ dependency "rake", "> 0", :development
16
17
  dependency "minitest-server", "~> 1.0"
17
18
  end
18
19
 
@@ -28,11 +29,12 @@ def banner text
28
29
  puts "# #{text} ::"
29
30
  puts "#" * 70
30
31
  puts
31
- unless ENV["SLEEP"] == "0" then
32
- print "Press return to continue "
33
- $stdin.gets
34
- puts
35
- end
32
+
33
+ return if ENV["SLEEP"] == "0"
34
+
35
+ print "Press return to continue "
36
+ $stdin.gets
37
+ puts
36
38
  end
37
39
 
38
40
  def run cmd
@@ -44,7 +46,7 @@ def req glob
44
46
  end
45
47
 
46
48
  task :repro do
47
- unless ENV.has_key? "SLEEP" then
49
+ unless ENV.key? "SLEEP" then
48
50
  warn "NOTE: Defaulting to sleeping 0.01 seconds per test."
49
51
  warn "NOTE: Use SLEEP=0 to disable or any other value to simulate your tests."
50
52
  end
@@ -59,7 +61,7 @@ task :repro do
59
61
  end
60
62
 
61
63
  task :many do
62
- unless ENV.has_key? "SLEEP" then
64
+ unless ENV.key? "SLEEP" then
63
65
  warn "NOTE: Defaulting to sleeping 0.01 seconds per test."
64
66
  warn "NOTE: Use SLEEP=0 to disable or any other value to simulate your tests."
65
67
  end
@@ -7,7 +7,7 @@ def create_test suffix, n_methods, bad_methods = {}
7
7
 
8
8
  Class.new(Minitest::Test) do
9
9
  n_methods.times do |n|
10
- n = n + 1
10
+ n += 1
11
11
  define_method "test_bad#{suffix}_#{n}" do
12
12
  sleep delay if delay > 0
13
13
 
data/example/helper.rb CHANGED
@@ -7,7 +7,7 @@ def create_test suffix, n_methods, bad_methods = {}
7
7
 
8
8
  Class.new(Minitest::Test) do
9
9
  n_methods.times do |n|
10
- n = n + 1
10
+ n += 1
11
11
  define_method "test_bad#{suffix}_#{n}" do
12
12
  sleep delay if delay > 0
13
13
 
@@ -1,11 +1,18 @@
1
1
  require "minitest/find_minimal_combination"
2
2
  require "minitest/server"
3
3
  require "shellwords"
4
+ require "rbconfig"
4
5
 
5
6
  class Minitest::Bisect
6
- VERSION = "1.2.1"
7
+ VERSION = "1.2.2"
7
8
 
8
- SHH = ENV["MTB_VERBOSE"].to_i >= 2 ? nil : " &> /dev/null"
9
+ SHH = ENV["MTB_VERBOSE"].to_i >= 2 ? nil : " > /dev/null 2>&1"
10
+
11
+ # Borrowed from rake
12
+ RUBY = ENV['RUBY'] ||
13
+ File.join(RbConfig::CONFIG['bindir'],
14
+ RbConfig::CONFIG['ruby_install_name'] +
15
+ RbConfig::CONFIG['EXEEXT']).sub(/.*\s.*/m, '"\&"')
9
16
 
10
17
  attr_accessor :tainted, :failures, :culprits, :mode, :seen_bad
11
18
  alias :tainted? :tainted
@@ -16,7 +23,7 @@ class Minitest::Bisect
16
23
 
17
24
  def initialize
18
25
  self.culprits = []
19
- self.failures = Hash.new { |h,k| h[k] = Hash.new { |h2,k2| h2[k2] = [] } }
26
+ self.failures = Hash.new { |h, k| h[k] = Hash.new { |h2, k2| h2[k2] = [] } }
20
27
  end
21
28
 
22
29
  def reset
@@ -109,9 +116,9 @@ class Minitest::Bisect
109
116
  def build_files_cmd culprits, rb, mt
110
117
  reset
111
118
 
112
- tests = culprits.flatten.compact.map {|f| %(require "./#{f}")}.join " ; "
119
+ tests = culprits.flatten.compact.map { |f| %(require "./#{f}") }.join " ; "
113
120
 
114
- %(ruby #{rb.shelljoin} -e '#{tests}' -- #{mt.shelljoin})
121
+ %(#{RUBY} #{rb.shelljoin} -e '#{tests}' -- #{mt.map(&:to_s).shelljoin})
115
122
  end
116
123
 
117
124
  def build_methods_cmd cmd, culprits = [], bad = nil
@@ -163,9 +170,9 @@ class Minitest::Bisect
163
170
  end
164
171
  end
165
172
 
166
- unless fails.empty?
167
- self.tainted = true
168
- self.failures[file][klass] << method
169
- end
173
+ return if fails.empty?
174
+
175
+ self.tainted = true
176
+ self.failures[file][klass] << method
170
177
  end
171
178
  end
@@ -40,7 +40,7 @@ class ComboFinder
40
40
 
41
41
  d
42
42
  d "# new round!"
43
- d "# of subsections in this round: #{subsections.size}"
43
+ d "# of subsections in this round: #{subsections.to_a.size}"
44
44
  d
45
45
 
46
46
  found = subsections.find { |a|
@@ -79,7 +79,7 @@ class ComboFinder
79
79
  ary
80
80
  end
81
81
 
82
- def d s=""
82
+ def d s = ""
83
83
  warn s if ENV["MTB_DEBUG"]
84
84
  end
85
85
 
@@ -5,6 +5,6 @@ module TestMinitest; end
5
5
 
6
6
  class TestMinitest::TestBisect < Minitest::Test
7
7
  def test_sanity
8
- flunk "write tests or I will kneecap you"
8
+ # nothing yet... ugh.
9
9
  end
10
10
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  $: << "." << "lib"
4
4
 
5
- gem "minitest"
6
5
  require "minitest/autorun"
7
6
  require "minitest/find_minimal_combination"
8
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-bisect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -29,7 +29,7 @@ cert_chain:
29
29
  xJcC6UN6NHMOVMyAXsr2HR0gRRx4ofN1LoP2KhXzSr8UMvQYlwPmE0N5GQv1b5AO
30
30
  VpzF30vNaJK6ZT7xlIsIlwmH
31
31
  -----END CERTIFICATE-----
32
- date: 2014-12-13 00:00:00.000000000 Z
32
+ date: 2015-04-27 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: minitest-server
@@ -51,14 +51,14 @@ dependencies:
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '5.5'
54
+ version: '5.6'
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '5.5'
61
+ version: '5.6'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: rdoc
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -73,6 +73,20 @@ dependencies:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '4.0'
76
+ - !ruby/object:Gem::Dependency
77
+ name: rake
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>'
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>'
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
76
90
  - !ruby/object:Gem::Dependency
77
91
  name: hoe
78
92
  requirement: !ruby/object:Gem::Requirement
@@ -160,11 +174,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
174
  version: '0'
161
175
  requirements: []
162
176
  rubyforge_project:
163
- rubygems_version: 2.4.1
177
+ rubygems_version: 2.4.5
164
178
  signing_key:
165
179
  specification_version: 4
166
180
  summary: Hunting down random test failures can be very very difficult, sometimes impossible,
167
181
  but minitest-bisect makes it easy
168
- test_files:
169
- - test/minitest/test_bisect.rb
170
- - test/minitest/test_find_minimal_combination.rb
182
+ test_files: []
metadata.gz.sig CHANGED
Binary file