maxitest 2.6.0 → 2.7.0

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: 20973fe8557945530cbbd8a56d53d7be50823d78
4
- data.tar.gz: f0fa1456177bf2299e841493caffc0f05d46d979
3
+ metadata.gz: 8f2001796af195514438fa52362627e60627b0ac
4
+ data.tar.gz: 6f69b87ae24322e2012e95f94d5e7e05d7502e34
5
5
  SHA512:
6
- metadata.gz: 77c06c2764f115531df1332943d98820fd27e4766924454ffc5733557e7eee01fb1df45b3a9d96a1cb92455b9434de999aebef5d7224ea20db6b1e016361efce
7
- data.tar.gz: ed0248417832fc20a396d1cc0b96455e8b1973d901036f00b71772359b5b2e6d55560908be097ff8ef1fac1cca027ee39fb2a6dbde6a66cbd813f52c554882a1
6
+ metadata.gz: 0d73abd17ee4bcefa1ab9ccc5c0de34dd1f4f069fbe5d7efe704919dbcebc8cca9e7cdd248df0a404b5874baa70db10345ed6dc3d398a2fb39023a1defde6d63
7
+ data.tar.gz: 353c04c531393053b34347cb065215a1744c2e5768de5fee70ca4f09c7aed820b192b82f4d46adb9ecec7aead3d09496a3f0f8dd89004979bbdfad1fb0d10bfc
@@ -9,16 +9,18 @@ module Maxitest
9
9
  module Timeout
10
10
  class TestCaseTimeout < StandardError
11
11
  def message
12
- "Test took too long to finish, aborting. To use a debugger, set Maxitest.timeout = false at the top of the test file."
12
+ "Test took too long to finish, aborting. To use a debugger, def maxitest_timeout;false;end in the test file."
13
13
  end
14
14
  end
15
15
 
16
16
  def capture_exceptions(*, &block)
17
- if Maxitest.timeout == false
17
+ # NOTE: having a default def maxitest_timeout would break using let(:maxitest_timeout)
18
+ timeout = (defined?(maxitest_timeout) ? maxitest_timeout : Maxitest.timeout || 5)
19
+ if timeout == false
18
20
  super
19
21
  else
20
22
  super do
21
- ::Timeout.timeout(Maxitest.timeout || 5, TestCaseTimeout, &block)
23
+ ::Timeout.timeout(timeout, TestCaseTimeout, &block)
22
24
  end
23
25
  end
24
26
  end
@@ -1,3 +1,3 @@
1
1
  module Maxitest
2
- VERSION = "2.6.0"
2
+ VERSION = "2.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maxitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-26 00:00:00.000000000 Z
11
+ date: 2018-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest