minitest-around 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.rdoc +12 -16
- data/Rakefile +9 -0
- data/examples/chdir_spec.rb +18 -0
- data/lib/minitest/around/spec.rb +8 -6
- data/lib/minitest/around/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e74398d843d7c3801fd2d6daf3b8ac1101592bb7
|
4
|
+
data.tar.gz: 37c7b514013ebd08ebc53a0a65a61b84ee7b6dc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e0264637f8969caaf09efb7aaaa35b21b8b6a4b473a32ff8c1ba4214682417e81c4fde613b2081632323771943eb352656ffcb2a704802012ab59f4c5d96fcf
|
7
|
+
data.tar.gz: a41bae9f6bc0aa9f382f911d4e55ff6ec3ca596286b671ca83985d87f1122117cf249fb9e3b05d7f6091e90c62947dcd5329d9acee8be54682b80e76faf356ab
|
data/README.rdoc
CHANGED
@@ -16,6 +16,8 @@ RDoc[http://rubydoc.info/github/splattael/minitest-around/master/file/README.rdo
|
|
16
16
|
|
17
17
|
== Usage
|
18
18
|
|
19
|
+
See examples[https://github.com/splattael/minitest-around/tree/master/examples] directory for some example usage..
|
20
|
+
|
19
21
|
=== Unit tests
|
20
22
|
|
21
23
|
require 'minitest/autorun'
|
@@ -46,26 +48,20 @@ RDoc[http://rubydoc.info/github/splattael/minitest-around/master/file/README.rdo
|
|
46
48
|
|
47
49
|
require 'minitest/autorun'
|
48
50
|
require 'minitest/around/spec'
|
49
|
-
require '
|
51
|
+
require 'tmpdir'
|
50
52
|
|
51
|
-
describe "
|
53
|
+
describe "inside new directory" do
|
52
54
|
around do |test|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
end
|
59
|
-
|
60
|
-
describe "pass args" do
|
61
|
-
around do
|
62
|
-
# No block arg "test",
|
63
|
-
[ 1, 2 ]
|
55
|
+
Dir.mktmpdir do |dir|
|
56
|
+
$dir = dir
|
57
|
+
Dir.chdir(dir) do
|
58
|
+
test.call
|
59
|
+
end
|
64
60
|
end
|
61
|
+
end
|
65
62
|
|
66
|
-
|
67
|
-
|
68
|
-
end
|
63
|
+
it "is in new directory" do
|
64
|
+
assert_equal $dir, Dir.pwd
|
69
65
|
end
|
70
66
|
end
|
71
67
|
|
data/Rakefile
CHANGED
@@ -28,3 +28,12 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
28
28
|
rdoc.main = 'README.rdoc'
|
29
29
|
rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'lib/**/*.rb')
|
30
30
|
end
|
31
|
+
|
32
|
+
# Examples
|
33
|
+
EXAMPLES = FileList["examples/*.rb"]
|
34
|
+
desc "Run all examples"
|
35
|
+
task :"test:examples" do
|
36
|
+
EXAMPLES.each do |example|
|
37
|
+
sh "bundle", "exec", "ruby", example
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'minitest/around/spec'
|
3
|
+
require 'tmpdir'
|
4
|
+
|
5
|
+
describe "inside new directory" do
|
6
|
+
around do |test|
|
7
|
+
Dir.mktmpdir do |dir|
|
8
|
+
$dir = dir
|
9
|
+
Dir.chdir(dir) do
|
10
|
+
test.call
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it "is in new directory" do
|
16
|
+
assert_equal $dir, Dir.pwd
|
17
|
+
end
|
18
|
+
end
|
data/lib/minitest/around/spec.rb
CHANGED
@@ -4,12 +4,14 @@ require 'minitest/around/version'
|
|
4
4
|
require 'minitest/around/unit'
|
5
5
|
|
6
6
|
class MiniTest::Spec
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
outer.
|
11
|
-
|
12
|
-
|
7
|
+
module DSL
|
8
|
+
def around(&outer)
|
9
|
+
define_method(:around) do |&inner|
|
10
|
+
if outer.arity == 1
|
11
|
+
outer.call(inner)
|
12
|
+
else
|
13
|
+
inner.call *outer.call
|
14
|
+
end
|
13
15
|
end
|
14
16
|
end
|
15
17
|
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.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Suschlik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- LICENSE
|
52
52
|
- README.rdoc
|
53
53
|
- Rakefile
|
54
|
+
- examples/chdir_spec.rb
|
54
55
|
- examples/mutex_spec.rb
|
55
56
|
- examples/mutex_test.rb
|
56
57
|
- lib/minitest/around.rb
|
@@ -85,3 +86,4 @@ signing_key:
|
|
85
86
|
specification_version: 4
|
86
87
|
summary: Around block for minitest.
|
87
88
|
test_files: []
|
89
|
+
has_rdoc:
|