minitest-around 0.2.0.pre → 0.2.0.pre2

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: b8b6c586cacf0c22de37cbfcad9787667212d43d
4
- data.tar.gz: 9f45e41f76cd08e01ce39c69167aa20c174d0d9a
3
+ metadata.gz: cda60c7a4c065dcf16070c161a0d7adb249796e6
4
+ data.tar.gz: 3948e7b82902432b9e93057084c217df75b3bbcb
5
5
  SHA512:
6
- metadata.gz: a0875c6e0dbfa057708be548c4694bcd9a8598d97dd5ff9c31a15dd4297e431f4f5c24bac7dab9b412447169f7505d1e76eee0dd7d748ba26d885a6d6589dca8
7
- data.tar.gz: 9ab900ca329d49d4ee3d124767b94edc0f52984c775e91a58e0de3efae6f3839fe2099bbdcb03c09db0c0ade9dac8d56d9c6b5ad64b4235c6c6c6badb31f034a
6
+ metadata.gz: 1633f55347c5db480a113bdca36c493117efd0aa107d3166b993fbfc726c6b8fc6be835aeba3544af6214a3171b15f2b721444061475f239ef4b3c1de0004411
7
+ data.tar.gz: 1e7c2f619f9e327d4a0a6f3331c644229f9400ea8ecde9fb8bef15bd500d06bbd1d05d21e3b6fe2a9489d92b00fec92b293bf3327838a74006355a7adb5a43c0
@@ -23,7 +23,7 @@ class Minitest::Spec
23
23
  end
24
24
 
25
25
  def after(type=nil, &block)
26
- include Module.new { define_method(:after) { super(); instance_exec(&block) } }
26
+ include Module.new { define_method(:teardown) { instance_exec(&block); super() } }
27
27
  end
28
28
  end
29
29
  end
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Around
3
- VERSION = '0.2.0.pre'
3
+ VERSION = '0.2.0.pre2'
4
4
  end
5
5
  end
data/test/around_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'minitest/autorun'
1
+ require_relative 'helper'
2
2
  require 'minitest/around/spec'
3
3
 
4
4
  describe "Minitest Around" do
@@ -38,20 +38,20 @@ describe "Minitest Around" do
38
38
  let(:list) { [] }
39
39
  before { list << 1 }
40
40
  before { list << 2 }
41
- after { list << 6 }
42
- around { |t| list << 3; t.call; list << 7 }
43
- before { list << 4 }
44
- around { |t| list << 5; t.call; list << 8 }
45
- after { list << 9 }
46
41
  after do
47
42
  if @xxx == 1
48
- list.must_equal [1, 2, 3, 4, 5, 6, 7, 8, 9]
43
+ list.must_equal [1, 2, 3, 4, 5, 9, 8, 7, 6]
49
44
  elsif @xxx == 2
50
- list.must_equal [1, 2, 3, 4, 5, 51, 6, 7, 8, 9]
45
+ list.must_equal [1, 2, 3, 4, 5, 51, 9, 8, 7, 6]
51
46
  else
52
47
  raise
53
48
  end
54
49
  end
50
+ after { list << 6 }
51
+ around { |t| list << 3; t.call; list << 7 }
52
+ before { list << 4 }
53
+ around { |t| list << 5; t.call; list << 8 }
54
+ after { list << 9 }
55
55
 
56
56
  it "orders" do
57
57
  @xxx = 1
data/test/around_test.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'minitest/autorun'
1
+ require_relative 'helper'
2
2
  require 'minitest/around/unit'
3
3
 
4
4
  class TestWithoutAround < Minitest::Test
data/test/helper.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler/setup'
2
+ require 'minitest/autorun'
data/test/nested_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'minitest/autorun'
1
+ require_relative 'helper'
2
2
  require 'minitest/around'
3
3
 
4
4
  $var = []
@@ -9,7 +9,7 @@ describe 'Outer' do
9
9
  end
10
10
  after do
11
11
  $var << :after
12
- $var.must_equal [:before, :ibefore, :begin, :ibegin, :during, :iend, :end, :iafter, :after]
12
+ $var.must_equal [:before, :begin, :ibefore, :ibegin, :during, :iend, :iafter, :end, :after]
13
13
  end
14
14
  around do |test|
15
15
  $var << :begin
data/test/nested_test.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'minitest/autorun'
1
+ require_relative 'helper'
2
2
  require 'minitest/around/unit'
3
3
 
4
4
  $var = []
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.pre
4
+ version: 0.2.0.pre2
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-01-28 00:00:00.000000000 Z
11
+ date: 2014-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -73,6 +73,7 @@ files:
73
73
  - minitest-around.gemspec
74
74
  - test/around_spec.rb
75
75
  - test/around_test.rb
76
+ - test/helper.rb
76
77
  - test/nested_spec.rb
77
78
  - test/nested_test.rb
78
79
  homepage: https://github.com/splattael/minitest-around