minitest-around 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +1 -0
- data/lib/minitest/around/spec.rb +9 -1
- data/lib/minitest/around/version.rb +1 -1
- data/minitest-around.gemspec +1 -0
- data/test/around_spec.rb +19 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7c7a4ec370a7fb3326bd4855752b79bd5202a1d88706a07be11345d3d3c42843
|
4
|
+
data.tar.gz: 515d088de014b8d3d184e03ddb3b62f851524a8ddfc4307fd7ccbce84e549ef4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a128f8ad7a55b6ede9675c3e8b8206b4a6ba86ce5c7479d3b9dc89860e97f4b2dca55dbfbd34aaf719bc6567c518c30521fda60def5f94aec39141412e72f3e6
|
7
|
+
data.tar.gz: 8675e5df5437232def5b1757f26bfeb27cf33d8f445cb0e839169045b910068dba565027d82c8eba2a6f7bd49f78a4857084564f8117776e32b1dc69848e689f
|
data/Rakefile
CHANGED
data/lib/minitest/around/spec.rb
CHANGED
@@ -31,6 +31,14 @@ Minitest::Spec::DSL.class_eval do
|
|
31
31
|
|
32
32
|
remove_method :after
|
33
33
|
def after(type=nil, &block)
|
34
|
-
include
|
34
|
+
include(Module.new do
|
35
|
+
define_method(:teardown) do
|
36
|
+
begin
|
37
|
+
instance_exec(&block)
|
38
|
+
ensure
|
39
|
+
super()
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end)
|
35
43
|
end
|
36
44
|
end
|
data/minitest-around.gemspec
CHANGED
data/test/around_spec.rb
CHANGED
@@ -82,6 +82,25 @@ describe "Minitest Around" do
|
|
82
82
|
output.wont_include "FiberError"
|
83
83
|
end
|
84
84
|
end
|
85
|
+
|
86
|
+
describe "ensure blocks in around" do
|
87
|
+
it "runs the ensure block even if another teardown fails" do
|
88
|
+
output = spawn_test <<-RUBY
|
89
|
+
describe "x" do
|
90
|
+
around do |b|
|
91
|
+
begin
|
92
|
+
b.call
|
93
|
+
ensure
|
94
|
+
puts "ENSURE"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
after { raise }
|
98
|
+
it("x") {}
|
99
|
+
end
|
100
|
+
RUBY
|
101
|
+
output.must_include("ENSURE")
|
102
|
+
end
|
103
|
+
end
|
85
104
|
end
|
86
105
|
|
87
106
|
def spawn_test(code)
|
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Leitzen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 2.4.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bump
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Alternative for setup/teardown dance.
|
70
84
|
email:
|
71
85
|
- peter-minitest-around@suschlik.de
|
@@ -114,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
128
|
version: '0'
|
115
129
|
requirements: []
|
116
130
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.6
|
131
|
+
rubygems_version: 2.7.6
|
118
132
|
signing_key:
|
119
133
|
specification_version: 4
|
120
134
|
summary: Around block for minitest.
|