matest 1.5.2 → 1.5.3

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: ddee0926bcefaf6e0acacfebc26d28fe557c0b92
4
- data.tar.gz: 422c64d8e865c8696f92fb1cd9bd05e511e4bcd5
3
+ metadata.gz: a20475ba5064a302ebc0c15c66b89d1397aca7cd
4
+ data.tar.gz: 44348821c95ddb0fc69359db9bcac993f31e1eb9
5
5
  SHA512:
6
- metadata.gz: e57626d838282b596f8b85eb6a6cc4d8625bcea48b276c861a066a5eb7708d3de27e67054bfb9ca8b0300f435ef40d77c0f78433d38e50337693f34373458aca
7
- data.tar.gz: 2277d5af784b2280ed165b11dc32678dacfcff93d8a68ddecbf342015c3eb8e1f8977f227b87a57dd3a7a90d2b62fd6797f5b73e38b1feb74a89993702ea0c32
6
+ metadata.gz: b3280a9e1c7067cfbf03ffa82ca7c7eabe51e7b5c348e399320564d60beb3686bafb0bc39f61ea983b8f6ffd33d615dea0adbafd78daaf4234c1d864c28bdfc7
7
+ data.tar.gz: ab3739128bdf8f4a53741af7c6d3e1b8ac1749b005996e424b3535e42c6108d8ec9c956661199d8c7e251620fe148362fa5fd777fa2343e195a3aaec6dfbff66
data/lib/matest.rb CHANGED
@@ -11,6 +11,7 @@ require "matest/skip_me"
11
11
  require "matest/spec_status"
12
12
  require "matest/spec_printer"
13
13
  require "matest/top_level_methods"
14
+ require "matest/capture_exception"
14
15
 
15
16
  module Matest
16
17
  end
@@ -0,0 +1,14 @@
1
+ class NoExceptionRaised < RuntimeError; end
2
+ class UnexpectedExceptionRaised < RuntimeError; end
3
+
4
+ def capture_exception(exception_class=BasicObject, &block)
5
+ begin
6
+ block.call
7
+ raise NoExceptionRaised.new
8
+ false
9
+ rescue exception_class => e
10
+ e
11
+ rescue BasicObject => e
12
+ raise UnexpectedExceptionRaised.new
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module Matest
2
- VERSION = "1.5.2"
2
+ VERSION = "1.5.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Iachetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-16 00:00:00.000000000 Z
11
+ date: 2015-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,6 +81,7 @@ files:
81
81
  - Rakefile
82
82
  - bin/matest
83
83
  - lib/matest.rb
84
+ - lib/matest/capture_exception.rb
84
85
  - lib/matest/color.rb
85
86
  - lib/matest/configure.rb
86
87
  - lib/matest/evaluator.rb