brass 1.2.1 → 1.3.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
- data/LICENSE.txt +22 -0
- data/README.md +31 -16
- data/{HISTORY.rdoc → VERSIONS.md} +20 -5
- data/lib/brass/adapters/minitest.rb +18 -21
- data/lib/brass.rb +23 -4
- metadata +43 -50
- data/.ruby +0 -53
- data/.yardopts +0 -7
- data/COPYING.rdoc +0 -38
- data/lib/brass/adapters/testunit1.rb +0 -42
- data/test/case_brass.rb +0 -22
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c1aff0f1fb1eef83ed9e88118c9ad9905d7307bd4e4734f33cbc8f2e9b62db58
|
|
4
|
+
data.tar.gz: 9c66d0e7c03cb039a01d0db8a754266fafce40ac2cdf9c66f28d742bcd4c2ccb
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 39e3b53191b8ca07d46d2bc550ab3a763a18c420079b2e3223119c2ae1896712bbe9f6fe3f06f99720bcfc34c397caffeb0a64b778839da61a5d463121c77ff7
|
|
7
|
+
data.tar.gz: 59e8313763da62429de70baeb3c9f8ed984587bbd78c808f40bce7b3c587aa1938233e12ebbf766921da5e9c0822666ec0e7356e590de587dd9a7bbddb879719
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(BSD-2-Clause License)
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
7
|
+
this list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
|
11
|
+
documentation and/or other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
14
|
+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
16
|
+
COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
17
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
18
|
+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
19
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
20
|
+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
21
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
22
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
# BRASS
|
|
2
2
|
|
|
3
|
-
[Website](
|
|
4
|
-
[Report Issue](
|
|
5
|
-
[Development](
|
|
3
|
+
[Website](https://rubyworks.github.io/brass) |
|
|
4
|
+
[Report Issue](https://github.com/rubyworks/brass/issues) |
|
|
5
|
+
[Development](https://github.com/rubyworks/brass)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<b>BRASS is a standard assertions framework, framework's framework, or even
|
|
8
|
+
a framework's framework's framework, depending on where you are staking
|
|
9
|
+
out your assertions keister. In other words, BRASS provides a foundational
|
|
10
|
+
assertions framework which all other assertion and test frameworks
|
|
11
|
+
can use, or at least comply with, and then everyone gets on swimmingly.</b>
|
|
8
12
|
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
## Status
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
[](https://rubygems.org/gems/brass)
|
|
17
|
+
[](https://github.com/rubyworks/brass/actions/workflows/test.yml)
|
|
18
|
+
[](https://github.com/rubyworks/brass/issues)
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
BRASS is a very basic assertions framework. It is designed to provide only
|
|
24
|
+
the barest essentials for making assertions such that other assertion and
|
|
25
|
+
test frameworks can use it, or at least comply with it, making all said
|
|
26
|
+
frameworks interoperable.
|
|
19
27
|
|
|
20
28
|
Now, you may be thinking, "No thanks, I do it my way." But when you see
|
|
21
29
|
how stupid simple BRASS is, you'll realize that, "Yea, that actually
|
|
22
30
|
make sense." And then maybe feel a bit stupid yourself for doing exactly
|
|
23
|
-
what this
|
|
31
|
+
what this paragraph just said you would do. Yea, well, we've all been there.
|
|
24
32
|
|
|
25
33
|
But enough with the fluff.
|
|
26
34
|
|
|
@@ -41,7 +49,7 @@ is either `RuntimeError` or the one specified by the `fail_arguments`.
|
|
|
41
49
|
The global assertions counter is `$ASSERTION_COUNTS`. It is simply a Hash formally
|
|
42
50
|
defined as:
|
|
43
51
|
|
|
44
|
-
$
|
|
52
|
+
$ASSERTION_COUNTS = Hash.new{|h,k| h[k] = 0}
|
|
45
53
|
|
|
46
54
|
And though it is open to any key, the keys should be symbols. Three keys in
|
|
47
55
|
particular and standard: `:pass`, `:fail` and `:total`. Whenever an assertion
|
|
@@ -58,15 +66,22 @@ to the Exception class along with the `#assertion?` method which any
|
|
|
58
66
|
test framework can use to distinguish an assertion error from an ordinarily
|
|
59
67
|
error.
|
|
60
68
|
|
|
61
|
-
And that's all there is to it. If you *
|
|
69
|
+
And that's all there is to it. If you *capisce* then consider yourself top brass.
|
|
62
70
|
|
|
63
71
|
Love, Peace and Brass Knuckles
|
|
64
72
|
|
|
65
73
|
|
|
66
|
-
##
|
|
74
|
+
## Contributing
|
|
75
|
+
|
|
76
|
+
This project is so basic it is unlikely anything will even change. But you
|
|
77
|
+
never can tell! so if your have a brilliant idea, jump right in. Source
|
|
78
|
+
code management is handled by ye ol'Github at https://github.com/rubyworks/brass.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Copyrights
|
|
67
82
|
|
|
68
83
|
Copyright (c) 2010 Rubyworks. All rights reserved.
|
|
69
84
|
|
|
70
85
|
Distribute in accordance with the **BSD-2-Clause** license.
|
|
71
86
|
|
|
72
|
-
See
|
|
87
|
+
See LICENSE.txt file for details.
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
# HISTORY
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 1.3.0 | 2026-03-30
|
|
4
|
+
|
|
5
|
+
Maintenance release. Modernized project tooling and cleaned up documentation.
|
|
6
|
+
|
|
7
|
+
Changes:
|
|
8
|
+
|
|
9
|
+
* Replace custom Indexer system with standard gemspec.
|
|
10
|
+
* Replace Travis CI with GitHub Actions.
|
|
11
|
+
* Replace Assembly/detroit with Rakefile.
|
|
12
|
+
* Fix typos in README and source code.
|
|
13
|
+
* Update URLs to HTTPS.
|
|
14
|
+
* Remove obsolete files (etc/, work/, MANIFEST).
|
|
15
|
+
* Clean up .gitignore.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.2.1 | 2012-02-09
|
|
4
19
|
|
|
5
20
|
This release adds framework adapters for MiniTest and TestUnit, which allows
|
|
6
21
|
those frameworks to recognize BRASS assertions as "failures" rather than
|
|
@@ -11,7 +26,7 @@ Changes:
|
|
|
11
26
|
* Add framework adapters for MiniTest and TestUnit.
|
|
12
27
|
|
|
13
28
|
|
|
14
|
-
|
|
29
|
+
## 1.2.0 | 2012-01-26
|
|
15
30
|
|
|
16
31
|
The default error is `RuntimeError` rather than `StandardError` to
|
|
17
32
|
match Ruby's default exception when no arguments are passed to `raise`.
|
|
@@ -21,7 +36,7 @@ Changes:
|
|
|
21
36
|
* Change default error to RuntimeError.
|
|
22
37
|
|
|
23
38
|
|
|
24
|
-
|
|
39
|
+
## 1.1.0 | 2012-01-25
|
|
25
40
|
|
|
26
41
|
Quick fix for issue with parsing arguments of #assert and #refute methods.
|
|
27
42
|
Also added #fail! method to dry-up code.
|
|
@@ -32,7 +47,7 @@ Changes:
|
|
|
32
47
|
* Add #fail! method to dry-up code.
|
|
33
48
|
|
|
34
49
|
|
|
35
|
-
|
|
50
|
+
## 1.0.0 | 2012-01-24
|
|
36
51
|
|
|
37
52
|
This is the initial release of BRASS. It is given a 1.0.0 version
|
|
38
53
|
despite being such a new project because it is very simple and
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
module
|
|
2
|
-
class
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
module Minitest #:nodoc:
|
|
2
|
+
class Test #:nodoc:
|
|
3
|
+
# Override capture_exceptions to recognize BRASS assertion errors
|
|
4
|
+
# as test failures rather than errors.
|
|
5
|
+
alias_method :capture_exceptions_without_brass, :capture_exceptions
|
|
6
|
+
|
|
7
|
+
def capture_exceptions
|
|
8
|
+
yield
|
|
9
|
+
rescue *PASSTHROUGH_EXCEPTIONS
|
|
10
|
+
raise
|
|
11
|
+
rescue Assertion => e
|
|
12
|
+
self.failures << e
|
|
13
|
+
rescue Exception => e
|
|
14
|
+
if e.respond_to?(:assertion?) && e.assertion?
|
|
15
|
+
failure = Assertion.new(e.message)
|
|
16
|
+
failure.set_backtrace(e.backtrace)
|
|
17
|
+
self.failures << failure
|
|
16
18
|
else
|
|
17
|
-
|
|
18
|
-
b = MiniTest::filter_backtrace(x.backtrace).join("\n ")
|
|
19
|
-
x = "Error:\n#{m}(#{c}):\n#{x.class}: #{x.message}\n #{b}\n"
|
|
19
|
+
self.failures << UnexpectedError.new(sanitize_exception(e))
|
|
20
20
|
end
|
|
21
|
-
@report << x
|
|
22
|
-
x[0, 1]
|
|
23
21
|
end
|
|
24
22
|
end
|
|
25
23
|
end
|
|
26
|
-
|
data/lib/brass.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
class Exception
|
|
2
2
|
|
|
3
|
-
# Is the exception an assertion
|
|
3
|
+
# Is the exception an assertion?
|
|
4
4
|
def assertion?
|
|
5
5
|
@assertion
|
|
6
6
|
end
|
|
@@ -18,19 +18,38 @@ class Exception
|
|
|
18
18
|
@mesg = msg.to_str
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# Set priority level.
|
|
22
|
+
#
|
|
23
|
+
# @param [Integer] level
|
|
24
|
+
# The priority level of the exception.
|
|
25
|
+
#
|
|
26
|
+
def set_priority(level)
|
|
27
|
+
@priority = level.to_i
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Exceptions can have priority levels.
|
|
31
|
+
#
|
|
32
|
+
# Zero is a nominal error, the higher the priority the more severe the
|
|
33
|
+
# error is considered. Errors with priorities less than zero are taken
|
|
34
|
+
# be warnings, the lower the number the more trivial.
|
|
35
|
+
#
|
|
36
|
+
def priority
|
|
37
|
+
@priority ||= 0
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# TODO: Consider assertion parameters for future version. If message
|
|
41
|
+
# does not have to be string, it might serve this purpose instead.
|
|
22
42
|
##
|
|
23
43
|
#def parameters
|
|
24
44
|
# @parameters
|
|
25
45
|
#end
|
|
26
46
|
#
|
|
27
47
|
## Set exception parameters. These are used to store specific information
|
|
28
|
-
##
|
|
48
|
+
## relevant to a particular exception or assertion. Unlike the message,
|
|
29
49
|
## which is a String, this is a Hash.
|
|
30
50
|
#def set_parameters(parameters)
|
|
31
51
|
# @parameters = parameters.to_hash
|
|
32
52
|
#end
|
|
33
|
-
|
|
34
53
|
end
|
|
35
54
|
|
|
36
55
|
module Kernel
|
metadata
CHANGED
|
@@ -1,98 +1,91 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: brass
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 1.3.0
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Thomas Sawyer
|
|
9
|
-
autorequire:
|
|
10
8
|
bindir: bin
|
|
11
9
|
cert_chain: []
|
|
12
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
11
|
dependencies:
|
|
14
12
|
- !ruby/object:Gem::Dependency
|
|
15
|
-
name:
|
|
16
|
-
requirement:
|
|
17
|
-
none: false
|
|
13
|
+
name: rake
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
18
15
|
requirements:
|
|
19
|
-
- -
|
|
16
|
+
- - ">="
|
|
20
17
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: '
|
|
18
|
+
version: '13'
|
|
22
19
|
type: :development
|
|
23
20
|
prerelease: false
|
|
24
|
-
version_requirements:
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '13'
|
|
25
26
|
- !ruby/object:Gem::Dependency
|
|
26
27
|
name: lemon
|
|
27
|
-
requirement:
|
|
28
|
-
none: false
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
|
-
- -
|
|
30
|
+
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '0'
|
|
32
|
+
version: '0.9'
|
|
33
33
|
type: :development
|
|
34
34
|
prerelease: false
|
|
35
|
-
version_requirements:
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0.9'
|
|
36
40
|
- !ruby/object:Gem::Dependency
|
|
37
41
|
name: rubytest
|
|
38
|
-
requirement:
|
|
39
|
-
none: false
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
40
43
|
requirements:
|
|
41
|
-
- -
|
|
44
|
+
- - ">="
|
|
42
45
|
- !ruby/object:Gem::Version
|
|
43
|
-
version: '0'
|
|
46
|
+
version: '0.8'
|
|
44
47
|
type: :development
|
|
45
48
|
prerelease: false
|
|
46
|
-
version_requirements:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0.8'
|
|
54
|
+
description: BRASS stands for Bare-Metal Ruby Assertion System Standard. It is a very
|
|
55
|
+
basic foundational assertions framework for other assertion and test frameworks
|
|
56
|
+
to make use so they can all work together harmoniously.
|
|
53
57
|
email:
|
|
54
58
|
- transfire@gmail.com
|
|
55
59
|
executables: []
|
|
56
60
|
extensions: []
|
|
57
|
-
extra_rdoc_files:
|
|
58
|
-
- HISTORY.rdoc
|
|
59
|
-
- COPYING.rdoc
|
|
60
|
-
- README.md
|
|
61
|
+
extra_rdoc_files: []
|
|
61
62
|
files:
|
|
62
|
-
- .
|
|
63
|
-
- .
|
|
63
|
+
- LICENSE.txt
|
|
64
|
+
- README.md
|
|
65
|
+
- VERSIONS.md
|
|
66
|
+
- lib/brass.rb
|
|
64
67
|
- lib/brass/adapters/minitest.rb
|
|
65
68
|
- lib/brass/adapters/testunit.rb
|
|
66
|
-
- lib/brass/adapters/testunit1.rb
|
|
67
69
|
- lib/brass/expect.rb
|
|
68
|
-
|
|
69
|
-
- test/case_brass.rb
|
|
70
|
-
- HISTORY.rdoc
|
|
71
|
-
- README.md
|
|
72
|
-
- COPYING.rdoc
|
|
73
|
-
homepage: http://rubyworks.github.com/brass
|
|
70
|
+
homepage: https://github.com/rubyworks/brass
|
|
74
71
|
licenses:
|
|
75
72
|
- BSD-2-Clause
|
|
76
|
-
|
|
73
|
+
metadata: {}
|
|
77
74
|
rdoc_options: []
|
|
78
75
|
require_paths:
|
|
79
76
|
- lib
|
|
80
77
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
|
-
none: false
|
|
82
78
|
requirements:
|
|
83
|
-
- -
|
|
79
|
+
- - ">="
|
|
84
80
|
- !ruby/object:Gem::Version
|
|
85
|
-
version: '
|
|
81
|
+
version: '3.1'
|
|
86
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
|
-
none: false
|
|
88
83
|
requirements:
|
|
89
|
-
- -
|
|
84
|
+
- - ">="
|
|
90
85
|
- !ruby/object:Gem::Version
|
|
91
86
|
version: '0'
|
|
92
87
|
requirements: []
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
specification_version: 3
|
|
97
|
-
summary: Bare-Metal Ruby Assertion System Standard
|
|
88
|
+
rubygems_version: 3.6.9
|
|
89
|
+
specification_version: 4
|
|
90
|
+
summary: Bare-metal Ruby Assertion System Standard
|
|
98
91
|
test_files: []
|
data/.ruby
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
source:
|
|
3
|
-
- meta
|
|
4
|
-
authors:
|
|
5
|
-
- name: Thomas Sawyer
|
|
6
|
-
email: transfire@gmail.com
|
|
7
|
-
copyrights:
|
|
8
|
-
- holder: Rubyworks
|
|
9
|
-
year: '2012'
|
|
10
|
-
license: BSD-2-Clause
|
|
11
|
-
replacements: []
|
|
12
|
-
alternatives: []
|
|
13
|
-
requirements:
|
|
14
|
-
- name: detroit
|
|
15
|
-
groups:
|
|
16
|
-
- build
|
|
17
|
-
development: true
|
|
18
|
-
- name: lemon
|
|
19
|
-
groups:
|
|
20
|
-
- test
|
|
21
|
-
development: true
|
|
22
|
-
- name: rubytest
|
|
23
|
-
groups:
|
|
24
|
-
- test
|
|
25
|
-
development: true
|
|
26
|
-
dependencies: []
|
|
27
|
-
conflicts: []
|
|
28
|
-
repositories:
|
|
29
|
-
- uri: git@github.com:rubyworks/brass.git
|
|
30
|
-
scm: git
|
|
31
|
-
name: upstream
|
|
32
|
-
resources:
|
|
33
|
-
home: http://rubyworks.github.com/brass
|
|
34
|
-
docs: http://rubydoc.info/gems/brass
|
|
35
|
-
code: http://github.com/rubyworks/brass
|
|
36
|
-
mail: http://groups.google.com/groups/rubyworks-mailinglist
|
|
37
|
-
extra: {}
|
|
38
|
-
load_path:
|
|
39
|
-
- lib
|
|
40
|
-
revision: 0
|
|
41
|
-
created: '2012-01-24'
|
|
42
|
-
summary: Bare-Metal Ruby Assertion System Standard
|
|
43
|
-
title: BRASS
|
|
44
|
-
version: 1.2.1
|
|
45
|
-
name: brass
|
|
46
|
-
description: ! 'BRASS stands for Bare-Metal Ruby Assertion System Standard. It is
|
|
47
|
-
a very basic
|
|
48
|
-
|
|
49
|
-
foundational assertions framework for other assertion and test frameworks
|
|
50
|
-
|
|
51
|
-
to make use so they can all work together harmoniously.'
|
|
52
|
-
organization: Rubyworks
|
|
53
|
-
date: '2012-02-09'
|
data/.yardopts
DELETED
data/COPYING.rdoc
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
= COPYRIGHT
|
|
2
|
-
|
|
3
|
-
== NOTICES
|
|
4
|
-
|
|
5
|
-
=== Brass
|
|
6
|
-
|
|
7
|
-
Copyright:: (c) 2012 RubyWorks
|
|
8
|
-
License:: (r) BSD-2-Clause
|
|
9
|
-
Website:: http://rubyworks.github.com/brass
|
|
10
|
-
|
|
11
|
-
== LICENSES
|
|
12
|
-
|
|
13
|
-
=== BSD-2-Clause License
|
|
14
|
-
|
|
15
|
-
Brass
|
|
16
|
-
|
|
17
|
-
Copyright (c) 2012 Rubyworks. All rights reserved.
|
|
18
|
-
|
|
19
|
-
Redistribution and use in source and binary forms, with or without
|
|
20
|
-
modification, are permitted provided that the following conditions are met:
|
|
21
|
-
|
|
22
|
-
1. Redistributions of source code must retain the above copyright notice,
|
|
23
|
-
this list of conditions and the following disclaimer.
|
|
24
|
-
|
|
25
|
-
2. Redistributions in binary form must reproduce the above copyright
|
|
26
|
-
notice, this list of conditions and the following disclaimer in the
|
|
27
|
-
documentation and/or other materials provided with the distribution.
|
|
28
|
-
|
|
29
|
-
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
30
|
-
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
31
|
-
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
32
|
-
COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
33
|
-
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
34
|
-
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
35
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
36
|
-
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
37
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
38
|
-
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
module Test #:nodoc:
|
|
2
|
-
module Unit #:nodoc:
|
|
3
|
-
class TestCase #:nodoc:
|
|
4
|
-
# Runs the individual test method represented by this
|
|
5
|
-
# instance of the fixture, collecting statistics, failures
|
|
6
|
-
# and errors in result.
|
|
7
|
-
def run(result)
|
|
8
|
-
yield(STARTED, name)
|
|
9
|
-
@_result = result
|
|
10
|
-
begin
|
|
11
|
-
setup
|
|
12
|
-
__send__(@method_name)
|
|
13
|
-
rescue AssertionFailedError => e
|
|
14
|
-
add_failure(e.message, e.backtrace)
|
|
15
|
-
rescue Exception => e
|
|
16
|
-
if e.respond_to?(:assertion?) && e.assertion?
|
|
17
|
-
add_failure(e.message, e.backtrace)
|
|
18
|
-
else
|
|
19
|
-
raise if PASSTHROUGH_EXCEPTIONS.include? $!.class
|
|
20
|
-
add_error($!)
|
|
21
|
-
end
|
|
22
|
-
ensure
|
|
23
|
-
begin
|
|
24
|
-
teardown
|
|
25
|
-
rescue AssertionFailedError => e
|
|
26
|
-
add_failure(e.message, e.backtrace)
|
|
27
|
-
rescue Exception => e
|
|
28
|
-
if e.respond_to?(:assertion?) && e.assertion?
|
|
29
|
-
add_failure(e.message, e.backtrace)
|
|
30
|
-
else
|
|
31
|
-
raise if PASSTHROUGH_EXCEPTIONS.include? $!.class
|
|
32
|
-
add_error($!)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
result.add_run
|
|
37
|
-
yield(FINISHED, name)
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|