assay-minitest 0.1.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.
- data/.ruby +52 -0
- data/COPYING.rdoc +39 -0
- data/HISTORY.rdoc +12 -0
- data/README.rdoc +75 -0
- data/lib/assay-minitest.rb +18 -0
- data/lib/assay-minitest.yml +52 -0
- data/lib/assay-minitest/assertions.rb +495 -0
- data/lib/assay-minitest/extensions.rb +474 -0
- data/lib/assay/minitest.rb +1 -0
- data/spec/01_minitest_extensions.rdoc +217 -0
- data/spec/02_minitest_assertions.rdoc +250 -0
- data/spec/applique/helper.rb +40 -0
- data/spec/applique/setup.rb +1 -0
- metadata +102 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
# Very simple helper assertion system, so we can test
|
3
|
+
# Assay without name clashes.
|
4
|
+
|
5
|
+
def assert(truth, msg=nil, trace=nil)
|
6
|
+
if truth
|
7
|
+
increment_counts(:pass)
|
8
|
+
else
|
9
|
+
increment_counts(:fail)
|
10
|
+
raise Assertion, msg || "assert failed", trace || caller
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def refute(truth)
|
15
|
+
assert(!truth, "refute failed", caller)
|
16
|
+
end
|
17
|
+
|
18
|
+
def expect(error)
|
19
|
+
counts = $ASSERTION_COUNTS.dup
|
20
|
+
begin
|
21
|
+
yield
|
22
|
+
$ASSERTION_COUNTS = counts
|
23
|
+
increment_counts(:fail)
|
24
|
+
raise Assertion, "#{error} not raised.", caller
|
25
|
+
rescue error
|
26
|
+
$ASSERTION_COUNTS = counts
|
27
|
+
increment_counts(:pass)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def increment_counts(which)
|
32
|
+
case which
|
33
|
+
when :pass
|
34
|
+
$ASSERTION_COUNTS[:pass] += 1
|
35
|
+
when :fail
|
36
|
+
$ASSERTION_COUNTS[:fail] += 1
|
37
|
+
end
|
38
|
+
$ASSERTION_COUNTS[:total] += 1
|
39
|
+
end
|
40
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'assay/minitest'
|
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: assay-minitest
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Thomas Sawyer
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-01-26 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: assay
|
16
|
+
requirement: &28325900 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *28325900
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: detroit
|
27
|
+
requirement: &28324840 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *28324840
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: qed
|
38
|
+
requirement: &28323980 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *28323980
|
47
|
+
description: ! 'Assay MiniTest defines a set of MiniTest-compatible assertion and
|
48
|
+
extension
|
49
|
+
|
50
|
+
method which seemlessly delegate on Assay assertions. This allows developers
|
51
|
+
|
52
|
+
to change test frameworks without having to completely rewrite a slew of
|
53
|
+
|
54
|
+
previously written MiniTest-based tests and/or sepcifications.'
|
55
|
+
email:
|
56
|
+
- transfire@gmail.com
|
57
|
+
executables: []
|
58
|
+
extensions: []
|
59
|
+
extra_rdoc_files:
|
60
|
+
- HISTORY.rdoc
|
61
|
+
- README.rdoc
|
62
|
+
- COPYING.rdoc
|
63
|
+
files:
|
64
|
+
- .ruby
|
65
|
+
- lib/assay/minitest.rb
|
66
|
+
- lib/assay-minitest/assertions.rb
|
67
|
+
- lib/assay-minitest/extensions.rb
|
68
|
+
- lib/assay-minitest.rb
|
69
|
+
- lib/assay-minitest.yml
|
70
|
+
- spec/01_minitest_extensions.rdoc
|
71
|
+
- spec/02_minitest_assertions.rdoc
|
72
|
+
- spec/applique/helper.rb
|
73
|
+
- spec/applique/setup.rb
|
74
|
+
- HISTORY.rdoc
|
75
|
+
- README.rdoc
|
76
|
+
- COPYING.rdoc
|
77
|
+
homepage: http://rubyworks.github.com/assay-minitest
|
78
|
+
licenses:
|
79
|
+
- BSD-2-Clause
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options: []
|
82
|
+
require_paths:
|
83
|
+
- lib
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ! '>='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
requirements: []
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 1.8.10
|
99
|
+
signing_key:
|
100
|
+
specification_version: 3
|
101
|
+
summary: MiniTest on Assay
|
102
|
+
test_files: []
|