ae 1.6.1 → 1.7.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 +33 -0
- data/{LICENSE → Apache2.txt} +3 -1
- data/{HISTORY.rdoc → History.rdoc} +18 -0
- data/NOTICE.rdoc +30 -0
- data/README.rdoc +38 -11
- data/Syckfile +82 -0
- data/lib/ae.rb +22 -19
- data/lib/ae.yml +33 -0
- data/lib/ae/adapters/minitest.rb +10 -17
- data/lib/ae/adapters/rspec.rb +1 -11
- data/lib/ae/adapters/testunit.rb +21 -20
- data/lib/ae/assert.rb +15 -8
- data/lib/ae/assertion.rb +36 -60
- data/lib/ae/assertor.rb +250 -178
- data/lib/ae/basic_object.rb +6 -10
- data/lib/ae/core_ext.rb +2 -208
- data/lib/ae/core_ext/exception.rb +13 -0
- data/lib/ae/core_ext/helpers.rb +198 -0
- data/lib/ae/expect.rb +2 -2
- data/lib/ae/must.rb +5 -1
- data/lib/ae/subjunctive.rb +1 -1
- data/lib/ae/version.rb +19 -0
- data/qed/01_overview.rdoc +1 -1
- data/qed/06_counts.rdoc +11 -7
- metadata +18 -17
- data/NOTICE +0 -14
- data/lib/ae/meta/data.rb +0 -29
- data/lib/ae/meta/package +0 -8
- data/lib/ae/meta/profile +0 -23
data/lib/ae/expect.rb
CHANGED
data/lib/ae/must.rb
CHANGED
@@ -32,7 +32,11 @@ module AE
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# Perhaps not literally the counter-term to *must* (rather *will*),
|
35
|
-
# it is close enough for our purposes and conveys the appropriate
|
35
|
+
# it is close enough for our purposes and conveys the appropriate
|
36
|
+
# semantics, and I think more sightly than *mustnt*.
|
37
|
+
#
|
38
|
+
# This method may be deprecated in the future when Ruby 1.9 becomes
|
39
|
+
# mainstream, as it allows for redefining *#!* as a method.
|
36
40
|
alias_method :wont, :must!
|
37
41
|
|
38
42
|
# Alias for #must! method.
|
data/lib/ae/subjunctive.rb
CHANGED
data/lib/ae/version.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
module AE
|
2
|
+
#
|
3
|
+
def self.metadata
|
4
|
+
@metadata ||= (
|
5
|
+
require 'yaml'
|
6
|
+
YAML.load(File.new(File.dirname(__FILE__) + '/../ae.yml'))
|
7
|
+
)
|
8
|
+
end
|
9
|
+
|
10
|
+
#
|
11
|
+
def self.const_missing(name)
|
12
|
+
key = name.to_s.downcase
|
13
|
+
metadata[key] || super(name)
|
14
|
+
end
|
15
|
+
|
16
|
+
# becuase Ruby 1.8~ gets in the way :(
|
17
|
+
VERSION = metadata['version']
|
18
|
+
end
|
19
|
+
|
data/qed/01_overview.rdoc
CHANGED
@@ -53,7 +53,7 @@ return an Assertor instance when used fluidly, i.e. magic-dot
|
|
53
53
|
notation, higher-order notation, functor notation, whatever you
|
54
54
|
prefer to call it.
|
55
55
|
|
56
|
-
assert(Assertor === assert)
|
56
|
+
assert(AE::Assertor === assert)
|
57
57
|
|
58
58
|
Through the use of +method_missing+, the Assertor allows us to write
|
59
59
|
statements like:
|
data/qed/06_counts.rdoc
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
AE tracks the number of assertions made and the number that failed to pass.
|
4
4
|
We can reset the count using the +recount+ class method.
|
5
5
|
|
6
|
-
|
6
|
+
old_counts = AE::Assertor.recount
|
7
7
|
|
8
|
-
For example if we one assertion
|
8
|
+
For example if we have one assertion pass and another fail.
|
9
9
|
|
10
10
|
assert(true)
|
11
11
|
|
@@ -15,15 +15,19 @@ For example if we one assertion fails and another fails.
|
|
15
15
|
|
16
16
|
We will see that AE counted three assertions and one failure.
|
17
17
|
|
18
|
-
|
19
|
-
Assertion.fails.assert == 1
|
18
|
+
counts = AE::Assertor.counts.dup
|
20
19
|
|
21
|
-
|
20
|
+
counts[:total].assert == 3
|
21
|
+
counts[:pass].assert == 2
|
22
|
+
counts[:fail].assert == 1
|
23
|
+
|
24
|
+
The #expect call is an assertion too, which is why the total count is 3
|
22
25
|
rather than 2.
|
23
26
|
|
24
27
|
Now that we are done checking counts we will restore them so that
|
25
28
|
any other demos being run with this will tally correctly.
|
26
29
|
|
27
|
-
|
28
|
-
|
30
|
+
AE::Assertor.recount(old_counts)
|
31
|
+
AE::Assertor.counts[:total] += 3
|
32
|
+
AE::Assertor.counts[:pass] += 3
|
29
33
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 7
|
9
|
+
- 0
|
10
|
+
version: 1.7.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Thomas Sawyer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-04-28 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -55,6 +55,7 @@ extensions: []
|
|
55
55
|
extra_rdoc_files:
|
56
56
|
- README.rdoc
|
57
57
|
files:
|
58
|
+
- .ruby
|
58
59
|
- qed/01_overview.rdoc
|
59
60
|
- qed/02_assertion.rdoc
|
60
61
|
- qed/03_assert.rdoc
|
@@ -71,27 +72,29 @@ files:
|
|
71
72
|
- lib/ae/assertor.rb
|
72
73
|
- lib/ae/basic_object.rb
|
73
74
|
- lib/ae/check.rb
|
75
|
+
- lib/ae/core_ext/exception.rb
|
76
|
+
- lib/ae/core_ext/helpers.rb
|
74
77
|
- lib/ae/core_ext.rb
|
75
78
|
- lib/ae/detest.rb
|
76
79
|
- lib/ae/dot.rb
|
77
80
|
- lib/ae/expect.rb
|
78
81
|
- lib/ae/legacy.rb
|
79
|
-
- lib/ae/meta/data.rb
|
80
|
-
- lib/ae/meta/package
|
81
|
-
- lib/ae/meta/profile
|
82
82
|
- lib/ae/must.rb
|
83
83
|
- lib/ae/pry.rb
|
84
84
|
- lib/ae/should.rb
|
85
85
|
- lib/ae/subjunctive.rb
|
86
|
+
- lib/ae/version.rb
|
86
87
|
- lib/ae.rb
|
87
|
-
-
|
88
|
-
- LICENSE
|
88
|
+
- lib/ae.yml
|
89
89
|
- README.rdoc
|
90
|
-
-
|
90
|
+
- Apache2.txt
|
91
|
+
- Syckfile
|
92
|
+
- History.rdoc
|
93
|
+
- NOTICE.rdoc
|
91
94
|
has_rdoc: true
|
92
|
-
homepage: http://
|
95
|
+
homepage: http://rubyworks.github.com/ae
|
93
96
|
licenses:
|
94
|
-
-
|
97
|
+
- Apache 2.0
|
95
98
|
post_install_message:
|
96
99
|
rdoc_options:
|
97
100
|
- --title
|
@@ -125,7 +128,5 @@ rubygems_version: 1.3.7
|
|
125
128
|
signing_key:
|
126
129
|
specification_version: 3
|
127
130
|
summary: Assertive Expressive
|
128
|
-
test_files:
|
129
|
-
|
130
|
-
- lib/ae/adapters/testunit.rb
|
131
|
-
- lib/ae/detest.rb
|
131
|
+
test_files: []
|
132
|
+
|
data/NOTICE
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
= COPYRIGHT NOTICES
|
2
|
-
|
3
|
-
== BasicObject
|
4
|
-
|
5
|
-
BasicObject is based on Jim Weirich's BlankSlate.
|
6
|
-
|
7
|
-
BlankSlate
|
8
|
-
Copyright 2004, 2006 by Jim Weirich (jim@weirichhouse.org).
|
9
|
-
All rights reserved.
|
10
|
-
|
11
|
-
Permission is granted for use, copying, modification, distribution,
|
12
|
-
and distribution of modified versions of this work as long as the
|
13
|
-
above copyright notice is included.
|
14
|
-
|
data/lib/ae/meta/data.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
Object.__send__(:remove_const, :VERSION) if Object.const_defined?(:VERSION) # becuase Ruby 1.8~ gets in the way
|
2
|
-
|
3
|
-
module AE
|
4
|
-
|
5
|
-
def self.__DIR__
|
6
|
-
File.dirname(__FILE__)
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.package
|
10
|
-
@package ||= (
|
11
|
-
require 'yaml'
|
12
|
-
YAML.load(File.new(__DIR__ + '/package'))
|
13
|
-
)
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.profile
|
17
|
-
@profile ||= (
|
18
|
-
require 'yaml'
|
19
|
-
YAML.load(File.new(__DIR__ + '/profile'))
|
20
|
-
)
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.const_missing(name)
|
24
|
-
key = name.to_s.downcase
|
25
|
-
package[key] || profile[key] || super(name)
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
data/lib/ae/meta/package
DELETED
data/lib/ae/meta/profile
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title : AE
|
3
|
-
summary: Assertive Expressive
|
4
|
-
suite : proutils
|
5
|
-
contact: trans <transfire@gmail.com>
|
6
|
-
created: 2008-08-17
|
7
|
-
authors: Thomas Sawyer
|
8
|
-
license: MIT
|
9
|
-
|
10
|
-
description:
|
11
|
-
Assertive Expressive is an assertions library specifically
|
12
|
-
designed for reuse by other test frameworks.
|
13
|
-
|
14
|
-
resources:
|
15
|
-
home: http://proutils.github.com/ae
|
16
|
-
code: http://github.com/proutils/ae
|
17
|
-
docs: http://wiki.github.com/proutils/ae/docs/qed
|
18
|
-
wiki: http://wiki.github.com/proutils/ae
|
19
|
-
bugs: http://github.com/proutils/ae/issues
|
20
|
-
mail: http://groups.google.com/group/rubyworks-mailinglist
|
21
|
-
repo: git://github.com/proutils/ae.git
|
22
|
-
|
23
|
-
copyright: Copyright (c) 2008 Thomas Sawyer
|