minitest-proveit 1.0.0
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 +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.autotest +26 -0
- data/History.rdoc +6 -0
- data/Manifest.txt +7 -0
- data/README.rdoc +65 -0
- data/Rakefile +18 -0
- data/lib/minitest/proveit.rb +49 -0
- data/test/test_minitest_proveit.rb +34 -0
- metadata +130 -0
- metadata.gz.sig +1 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f669eb27e746a3ea16508badcaecbc76255be3e2
|
4
|
+
data.tar.gz: 0e4882e86877a801f4fe7e6b9047ec19dd606d16
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7df43bbdd254b023f4199f7afffba6bd70f9002f485a9154e45e74c11bcdf8bf464ecc2893b432a08cc57c7aa9fa59ca533fe3af56dda44f204da3531dca8533
|
7
|
+
data.tar.gz: 2e63cee15679cfacc7bc5d58c1623c2220c3c0a16e94c68d7e7efd62a0be737f6f9ab63e993d07d839fa1ffef775c5f825ae925e290034c8f9d5a59262f60ea3
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
data/.autotest
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require "autotest/restart"
|
4
|
+
|
5
|
+
Autotest.add_hook :initialize do |at|
|
6
|
+
at.testlib = "minitest/autorun"
|
7
|
+
at.add_exception "tmp"
|
8
|
+
|
9
|
+
# at.extra_files << "../some/external/dependency.rb"
|
10
|
+
#
|
11
|
+
# at.libs << ":../some/external"
|
12
|
+
#
|
13
|
+
# at.add_exception "vendor"
|
14
|
+
#
|
15
|
+
# at.add_mapping(/dependency.rb/) do |f, _|
|
16
|
+
# at.files_matching(/test_.*rb$/)
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# %w(TestA TestB).each do |klass|
|
20
|
+
# at.extra_class_map[klass] = "test/test_misc.rb"
|
21
|
+
# end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Autotest.add_hook :run_command do |at|
|
25
|
+
# system "rake build"
|
26
|
+
# end
|
data/History.rdoc
ADDED
data/Manifest.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
= minitest-proveit
|
2
|
+
|
3
|
+
home :: https://github.com/seattlerb/minitest-proveit
|
4
|
+
rdoc :: http://docs.seattlerb.org/minitest-proveit
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
Originally written by github user bradleyjames, minitest-proveit
|
9
|
+
forces all tests to prove success (via at least one assertion) rather
|
10
|
+
than rely on the absence of failure.
|
11
|
+
|
12
|
+
== FEATURES/PROBLEMS:
|
13
|
+
|
14
|
+
* Activate and run your tests to ensure you have an assertion in each test.
|
15
|
+
* Opt-in, for now
|
16
|
+
* hooked via minitest/hell.
|
17
|
+
* export MT_HELL=1 to enable globally.
|
18
|
+
|
19
|
+
== SYNOPSIS:
|
20
|
+
|
21
|
+
class MyTest < Minitest::Test
|
22
|
+
prove_it!
|
23
|
+
|
24
|
+
def test_good
|
25
|
+
MyClass.do_the_thing
|
26
|
+
assert MyClass.did_the_thing_correctly?
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_bad
|
30
|
+
MyClass.do_the_thing # => test failure
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
== REQUIREMENTS:
|
35
|
+
|
36
|
+
* minitest 5+
|
37
|
+
|
38
|
+
== INSTALL:
|
39
|
+
|
40
|
+
* sudo gem install minitest-proveit
|
41
|
+
|
42
|
+
== LICENSE:
|
43
|
+
|
44
|
+
(The MIT License)
|
45
|
+
|
46
|
+
Copyright (c) Ryan Davis, seattle.rb
|
47
|
+
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
49
|
+
a copy of this software and associated documentation files (the
|
50
|
+
'Software'), to deal in the Software without restriction, including
|
51
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
52
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
53
|
+
permit persons to whom the Software is furnished to do so, subject to
|
54
|
+
the following conditions:
|
55
|
+
|
56
|
+
The above copyright notice and this permission notice shall be
|
57
|
+
included in all copies or substantial portions of the Software.
|
58
|
+
|
59
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
60
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
61
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
62
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
63
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
64
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
65
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "hoe"
|
5
|
+
|
6
|
+
Hoe.plugin :isolate
|
7
|
+
Hoe.plugin :seattlerb
|
8
|
+
Hoe.plugin :rdoc
|
9
|
+
|
10
|
+
Hoe.spec "minitest-proveit" do
|
11
|
+
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
12
|
+
|
13
|
+
license "MIT"
|
14
|
+
|
15
|
+
dependency "minitest", ["> 5", "< 7"]
|
16
|
+
end
|
17
|
+
|
18
|
+
# vim: syntax=ruby
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require "minitest/test"
|
2
|
+
|
3
|
+
module Minitest; end # :nodoc: -- ugh rdoc sucks hard sometimes
|
4
|
+
|
5
|
+
class Minitest::Test
|
6
|
+
VERSION = "1.0.0" # :nodoc:
|
7
|
+
|
8
|
+
##
|
9
|
+
# Getter for prove_it class variable
|
10
|
+
|
11
|
+
def self.prove_it
|
12
|
+
@@prove_it ||= false
|
13
|
+
end
|
14
|
+
|
15
|
+
##
|
16
|
+
# Setter for prove_it class variable. true/false
|
17
|
+
|
18
|
+
def self.prove_it= o
|
19
|
+
@@prove_it = o
|
20
|
+
end
|
21
|
+
|
22
|
+
##
|
23
|
+
# Call this at the top of your tests when you want to force all
|
24
|
+
# tests to prove success (via at least one assertion) rather
|
25
|
+
# than rely on the absence of failure.
|
26
|
+
|
27
|
+
def self.prove_it!
|
28
|
+
@@prove_it = true unless defined? @@prove_it
|
29
|
+
end
|
30
|
+
|
31
|
+
TEARDOWN_METHODS << "assert_proven?"
|
32
|
+
|
33
|
+
def assert_proven? # :nodoc:
|
34
|
+
flunk "Absence of failure is not success. Prove it!" if
|
35
|
+
self.class.prove_it && self.failures.empty? && self.assertions == 0
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
##
|
40
|
+
# Hooks Minitest::Test.run to enforce prove_it! for all tests.
|
41
|
+
#
|
42
|
+
# TODO: to be moved to minitest/hell?
|
43
|
+
|
44
|
+
class Minitest::Test
|
45
|
+
def self.run reporter, options = {} # :nodoc:
|
46
|
+
prove_it!
|
47
|
+
super
|
48
|
+
end
|
49
|
+
end if ENV["MT_HELL"]
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "minitest/proveit"
|
3
|
+
|
4
|
+
module TestMinitest; end
|
5
|
+
|
6
|
+
class ProveTest < Minitest::Test
|
7
|
+
self.prove_it!
|
8
|
+
|
9
|
+
def self.go(&b)
|
10
|
+
Class.new(ProveTest, &b).new(:test_something).run
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class TestMinitest::TestProve < Minitest::Test
|
15
|
+
def test_happy
|
16
|
+
tc = ProveTest.go do
|
17
|
+
def test_something
|
18
|
+
assert true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
assert_predicate tc, :passed?
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_sad
|
26
|
+
tc = ProveTest.go do
|
27
|
+
def test_something
|
28
|
+
# do nothing
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
refute_predicate tc, :passed?
|
33
|
+
end
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: minitest-proveit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan Davis
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDPjCCAiagAwIBAgIBAzANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
14
|
+
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
15
|
+
GRYDY29tMB4XDTE1MDkxOTIwNTEyMloXDTE2MDkxODIwNTEyMlowRTETMBEGA1UE
|
16
|
+
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
17
|
+
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
18
|
+
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
19
|
+
taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
|
20
|
+
oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
|
21
|
+
GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
|
22
|
+
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
23
|
+
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
24
|
+
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
|
25
|
+
AQB+Hx8xUgrpZa4P8H8gR8zme5kISwQrG80MbpqJV6/G3/ZicRFhN5sjwu0uHGue
|
26
|
+
bd9Cymf6oIRwHVarJux2M32T6bL07Hmi07w2QaPc3MnMKB/D46SRZ2JSSGPFRBTc
|
27
|
+
SilobMRoGs/7B15uGFUEnNrCB/ltMqhwwSx1r++UQPfeySHEV9uqu03E5Vb7J37O
|
28
|
+
2Er6PLXHRiYsIycD1LkMi6YnixdITRHmrqJYE2rsjaIfpIehiusVAPHkNf7qbpHq
|
29
|
+
qx3h45R1CAsObX0SQDIT+rRbQrtKz1GHIZTOFYvEJjUY1XmRTZupD3CJ8Q7sDqSy
|
30
|
+
NLq5jm1fq6Y9Uolu3RJbmycf
|
31
|
+
-----END CERTIFICATE-----
|
32
|
+
date: 2016-04-26 00:00:00.000000000 Z
|
33
|
+
dependencies:
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: minitest
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>'
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5'
|
41
|
+
- - <
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '7'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - '>'
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '5'
|
51
|
+
- - <
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '7'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rdoc
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ~>
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '4.0'
|
61
|
+
type: :development
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '4.0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: hoe
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ~>
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '3.15'
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ~>
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '3.15'
|
82
|
+
description: |-
|
83
|
+
Originally written by github user bradleyjames, minitest-proveit
|
84
|
+
forces all tests to prove success (via at least one assertion) rather
|
85
|
+
than rely on the absence of failure.
|
86
|
+
email:
|
87
|
+
- ryand-ruby@zenspider.com
|
88
|
+
executables: []
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files:
|
91
|
+
- History.rdoc
|
92
|
+
- Manifest.txt
|
93
|
+
- README.rdoc
|
94
|
+
files:
|
95
|
+
- .autotest
|
96
|
+
- History.rdoc
|
97
|
+
- Manifest.txt
|
98
|
+
- README.rdoc
|
99
|
+
- Rakefile
|
100
|
+
- lib/minitest/proveit.rb
|
101
|
+
- test/test_minitest_proveit.rb
|
102
|
+
homepage: https://github.com/seattlerb/minitest-proveit
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata: {}
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options:
|
108
|
+
- --main
|
109
|
+
- README.rdoc
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - '>='
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.4.5
|
125
|
+
signing_key:
|
126
|
+
specification_version: 4
|
127
|
+
summary: Originally written by github user bradleyjames, minitest-proveit forces all
|
128
|
+
tests to prove success (via at least one assertion) rather than rely on the absence
|
129
|
+
of failure.
|
130
|
+
test_files: []
|
metadata.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"#A�KUj^�r��yA)^��f��E"���d�3Y����~N�i/��.����<�>��_qBWR6�a,ׁ�`��k?/}<��������L�?�wWբhg�4˾��\\�f�>=G\#kd��c�?�Ǎ$�k^�a3��1M������>�������k[�s�px4-`���V;��tv��������7%�5�凣6NѴ�-.������t��F�=�4&=�A��s d(���������
|