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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9c391f553ee9e6049fd43081824bddc7973769f8
4
- data.tar.gz: '050277022766548815004037a5db0fe496564b39'
2
+ SHA256:
3
+ metadata.gz: 7c7a4ec370a7fb3326bd4855752b79bd5202a1d88706a07be11345d3d3c42843
4
+ data.tar.gz: 515d088de014b8d3d184e03ddb3b62f851524a8ddfc4307fd7ccbce84e549ef4
5
5
  SHA512:
6
- metadata.gz: '009f679adaa112d237f820e8088d8ea19846ac7f3f8898cba37e68422d712febddd4f2915beb9cd0c46d60d4920fb44da7e95c2419b523bca5be67e229595042'
7
- data.tar.gz: a97f223c48a33973a47e844ca2f893cefd9fff090552b625044a8597dbfd0c972d2a5887c1db9f08b98009dccae92eb571b8799463237788220883b0c4438b30
6
+ metadata.gz: a128f8ad7a55b6ede9675c3e8b8206b4a6ba86ce5c7479d3b9dc89860e97f4b2dca55dbfbd34aaf719bc6567c518c30521fda60def5f94aec39141412e72f3e6
7
+ data.tar.gz: 8675e5df5437232def5b1757f26bfeb27cf33d8f445cb0e839169045b910068dba565027d82c8eba2a6f7bd49f78a4857084564f8117776e32b1dc69848e689f
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'bundler/setup'
2
2
  require 'bundler/gem_tasks'
3
3
  require 'cucumber/rake/task'
4
+ require 'bump/tasks'
4
5
 
5
6
  desc 'Default: run unit tests.'
6
7
  task :default => [:test, :"test:isolated", :features]
@@ -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 Module.new { define_method(:teardown) { instance_exec(&block); super() } }
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
@@ -1,3 +1,3 @@
1
1
  module MinitestAround
2
- VERSION = '0.4.1'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -14,4 +14,5 @@ Gem::Specification.new "minitest-around", MinitestAround::VERSION do |s|
14
14
  s.add_development_dependency 'rdoc'
15
15
  s.add_development_dependency 'rake'
16
16
  s.add_development_dependency 'cucumber', '~> 2.4.0'
17
+ s.add_development_dependency 'bump'
17
18
  end
@@ -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.1
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-01-26 00:00:00.000000000 Z
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.13
131
+ rubygems_version: 2.7.6
118
132
  signing_key:
119
133
  specification_version: 4
120
134
  summary: Around block for minitest.