minitest-around 0.2.0 → 0.3.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: 0bc83c4224a6092d7207e66f08f9dda67b7240a6
4
- data.tar.gz: 1e482a21ee33f0e63648dad403f63b639e645d96
3
+ metadata.gz: 27d2dad8452908e2bd9b1f2f5d9a1de2b1fb9439
4
+ data.tar.gz: d3f652f5b43e308a41dfbfce07de2b8e16c98a8b
5
5
  SHA512:
6
- metadata.gz: d3eadf7b8b3da623847ea41c396556dbaef0adb5fa35ef77794b20f97b1f3bd94edb34017cb7fc44fe3c95b96938f2a518e58daba4a0f8d49b24650645602680
7
- data.tar.gz: 12538c05bbddcbd7aa49fe0470ce87fb4a50b85d859d508f17548c43a5cfd399cef6f106c9d0350816455413b16b7b83c0923133d4ba8dfce7c90f6180e166db
6
+ metadata.gz: a79085997989cd022d7c1a4a32d3cc7eb69daded244e3d0c6b146b18025dd98e412e02d6c3a6c1fe6a7731808da7704db4ff7ed3fdfbca62b470b8b91184b939
7
+ data.tar.gz: 75e7099b4dbbb8271ef7aee1aa23cfe9175a534b4adf76f9f5f888db75d8add02d4b2049594598193022019501988b78a333a73ff8fd50df4b16def11f10f500
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # minitest-around
2
2
 
3
- [![Build Status](https://travis-ci.org/splattael/minitest-around.png)](https://travis-ci.org/splattael/minitest-around) [![Inline docs](http://inch-pages.github.io/github/splattael/minitest-around.png)](http://inch-pages.github.io/github/splattael/minitest-around)
3
+ [![Build Status](https://travis-ci.org/splattael/minitest-around.png)](https://travis-ci.org/splattael/minitest-around) [![Inline docs](http://inch-ci.org/github/splattael/minitest-around.png)](http://inch-ci.org/github/splattael/minitest-around)
4
4
 
5
5
  Around block for minitest 5.X.
6
6
 
@@ -3,34 +3,32 @@ require 'minitest'
3
3
  require 'minitest/around/version'
4
4
  require 'minitest/around/unit'
5
5
 
6
- class Minitest::Spec
7
- module DSL
8
- # - resume to call first part
9
- # - execute test
10
- # - resume fiber to execute last part
11
- def around(&block)
12
- fib = nil
13
- before do
14
- fib = Fiber.new do |context, resume|
15
- begin
16
- context.instance_exec(resume, &block)
17
- rescue Object
18
- fib = :failed
19
- raise
20
- end
6
+ Minitest::Spec::DSL.class_eval do
7
+ # - resume to call first part
8
+ # - execute test
9
+ # - resume fiber to execute last part
10
+ def around(&block)
11
+ fib = nil
12
+ before do
13
+ fib = Fiber.new do |context, resume|
14
+ begin
15
+ context.instance_exec(resume, &block)
16
+ rescue Object
17
+ fib = :failed
18
+ raise
21
19
  end
22
- fib.resume(self, lambda { Fiber.yield })
23
20
  end
24
- after { fib.resume unless fib == :failed }
21
+ fib.resume(self, lambda { Fiber.yield })
25
22
  end
23
+ after { fib.resume unless fib == :failed }
24
+ end
26
25
 
27
- # Minitest does not support multiple before/after blocks
28
- def before(type=nil, &block)
29
- include Module.new { define_method(:setup) { super(); instance_exec(&block) } }
30
- end
26
+ # Minitest does not support multiple before/after blocks
27
+ def before(type=nil, &block)
28
+ include Module.new { define_method(:setup) { super(); instance_exec(&block) } }
29
+ end
31
30
 
32
- def after(type=nil, &block)
33
- include Module.new { define_method(:teardown) { instance_exec(&block); super() } }
34
- end
31
+ def after(type=nil, &block)
32
+ include Module.new { define_method(:teardown) { instance_exec(&block); super() } }
35
33
  end
36
34
  end
@@ -1,7 +1,7 @@
1
1
  require 'minitest'
2
2
  require 'minitest/around/version'
3
3
 
4
- class Minitest::Test
4
+ Minitest::Test.class_eval do
5
5
  alias_method :run_without_around, :run
6
6
  def run(*args)
7
7
  if defined?(around)
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Around
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-around
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Suschlik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-07 00:00:00.000000000 Z
11
+ date: 2014-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.2.2
113
+ rubygems_version: 2.4.2
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Around block for minitest.