ae 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby +5 -1
- data/HISTORY.rdoc +18 -1
- data/lib/ae.rb +18 -0
- data/lib/ae.yml +5 -1
- data/lib/ae/assertor.rb +18 -5
- metadata +23 -12
- data/Redfile +0 -82
data/.ruby
CHANGED
@@ -24,6 +24,10 @@ resources:
|
|
24
24
|
maintainers: []
|
25
25
|
|
26
26
|
requires:
|
27
|
+
- group: []
|
28
|
+
|
29
|
+
name: ansi
|
30
|
+
version: 0+
|
27
31
|
- group:
|
28
32
|
- build
|
29
33
|
name: redline
|
@@ -33,7 +37,7 @@ requires:
|
|
33
37
|
name: qed
|
34
38
|
version: 0+
|
35
39
|
manifest: MANIFEST
|
36
|
-
version: 1.7.
|
40
|
+
version: 1.7.2
|
37
41
|
licenses:
|
38
42
|
- Apache 2.0
|
39
43
|
copyright: Copyright (c) 2008 Thomas Sawyer
|
data/HISTORY.rdoc
CHANGED
@@ -1,14 +1,31 @@
|
|
1
1
|
= RELEASE HISTORY
|
2
2
|
|
3
|
+
== 1.7.2 / 2011-06-02
|
4
|
+
|
5
|
+
Minor release adds color diffs for failed equality comparisons to
|
6
|
+
the error message, and it fixes an issue in which class references
|
7
|
+
needed the toplevel prefix (`::`) to ensure they can be found in
|
8
|
+
all cases. Note that ANSI color diffs can be deactivated via
|
9
|
+
AE.ansi = false or using the master switch an upcoming release
|
10
|
+
of the ANSI gem.
|
11
|
+
|
12
|
+
Changes:
|
13
|
+
|
14
|
+
* Add toplevel prefix (`::`) to class references in assertor.rb.
|
15
|
+
* Provide ANSI colored diffs for failed equality comparisons.
|
16
|
+
|
17
|
+
|
3
18
|
== 1.7.1 / 2011-05-06
|
4
19
|
|
5
20
|
This release adds a specialized message for certain comparision
|
6
21
|
operators to allow them have a more forensic output. This is done
|
7
|
-
via ANSI::Diff library.
|
22
|
+
via ANSI::Diff library. This release also deprecateds the optional
|
23
|
+
dot.rb and detest.rb emulation scripts.
|
8
24
|
|
9
25
|
Changes:
|
10
26
|
|
11
27
|
* Add special message for comparison assertions.
|
28
|
+
* Remove optional dot.rb and detest.rb emulation scripts.
|
12
29
|
|
13
30
|
|
14
31
|
== 1.7.0 / 2011-04-28
|
data/lib/ae.rb
CHANGED
@@ -24,6 +24,24 @@ module AE
|
|
24
24
|
$VERBOSE = verbose
|
25
25
|
end
|
26
26
|
|
27
|
+
@ansi = true
|
28
|
+
|
29
|
+
#
|
30
|
+
def self.ansi?
|
31
|
+
@ansi
|
32
|
+
end
|
33
|
+
|
34
|
+
# To turn of ANSI colorized error messages off, set
|
35
|
+
# ansi to +false+ in your test helper.
|
36
|
+
#
|
37
|
+
# Example
|
38
|
+
#
|
39
|
+
# AE.ansi = false
|
40
|
+
#
|
41
|
+
def self.ansi=(boolean)
|
42
|
+
@ansi = boolean
|
43
|
+
end
|
44
|
+
|
27
45
|
end
|
28
46
|
|
29
47
|
require 'ae/version'
|
data/lib/ae.yml
CHANGED
@@ -24,6 +24,10 @@ resources:
|
|
24
24
|
maintainers: []
|
25
25
|
|
26
26
|
requires:
|
27
|
+
- group: []
|
28
|
+
|
29
|
+
name: ansi
|
30
|
+
version: 0+
|
27
31
|
- group:
|
28
32
|
- build
|
29
33
|
name: redline
|
@@ -33,7 +37,7 @@ requires:
|
|
33
37
|
name: qed
|
34
38
|
version: 0+
|
35
39
|
manifest: MANIFEST
|
36
|
-
version: 1.7.
|
40
|
+
version: 1.7.2
|
37
41
|
licenses:
|
38
42
|
- Apache 2.0
|
39
43
|
copyright: Copyright (c) 2008 Thomas Sawyer
|
data/lib/ae/assertor.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'ae/assertion'
|
2
2
|
require 'ae/basic_object'
|
3
|
+
require 'ansi/diff'
|
3
4
|
|
4
5
|
module AE
|
5
6
|
|
@@ -71,7 +72,7 @@ module AE
|
|
71
72
|
# The intent of the method is to raise an assertion failure
|
72
73
|
# class that the test framework supports.
|
73
74
|
def self.raise_assertion(error, negated, backtrace=nil)
|
74
|
-
if not Exception === error
|
75
|
+
if not ::Exception === error
|
75
76
|
error = assertion_error.new(error)
|
76
77
|
end
|
77
78
|
error.set_negative(negated)
|
@@ -307,10 +308,18 @@ module AE
|
|
307
308
|
COMPARISON_OPERATORS = { :"==" => :"!=" }
|
308
309
|
|
309
310
|
# Message to use when making a comparion assertion.
|
311
|
+
#
|
312
|
+
# NOTE: This message utilizes the ANSI gem to produce colorized
|
313
|
+
# comparisons. If you need to remove color output (for non-ANSI
|
314
|
+
# terminals) you can either set `AE.ansi = false` or use the
|
315
|
+
# ANSI library's master switch to deactive all ANSI codes,
|
316
|
+
# which can be set in your test helper.
|
317
|
+
#
|
318
|
+
# @see http://rubyworks.github.com/ansi
|
310
319
|
def compare_message(operator, *args, &blk)
|
311
320
|
return nil unless COMPARISON_OPERATORS.key?(operator)
|
312
321
|
prefix = ""
|
313
|
-
a, b
|
322
|
+
a, b = @delegate.inspect, args.first.inspect
|
314
323
|
if @negated
|
315
324
|
op = COMPARISON_OPERATORS[operator]
|
316
325
|
if op
|
@@ -319,11 +328,15 @@ module AE
|
|
319
328
|
prefix = "NOT "
|
320
329
|
end
|
321
330
|
end
|
331
|
+
if AE.ansi?
|
332
|
+
diff = ::ANSI::Diff.new(a,b)
|
333
|
+
a = diff.diff1
|
334
|
+
b = diff.diff2
|
335
|
+
end
|
322
336
|
if a.size > 13 or b.size > 13
|
323
|
-
|
324
|
-
prefix + "a #{operator} b\na) " + diff.diff1 + "\nb) " + diff.diff2
|
337
|
+
prefix + "a #{operator} b\na) " + a + "\nb) " + b
|
325
338
|
else
|
326
|
-
prefix + "#{a
|
339
|
+
prefix + "#{a} #{operator} #{b}"
|
327
340
|
end
|
328
341
|
end
|
329
342
|
|
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:
|
5
|
-
prerelease:
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 1.7.
|
9
|
+
- 2
|
10
|
+
version: 1.7.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Thomas Sawyer
|
@@ -15,11 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-06-03 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
21
|
+
name: ansi
|
23
22
|
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
@@ -30,10 +29,10 @@ dependencies:
|
|
30
29
|
segments:
|
31
30
|
- 0
|
32
31
|
version: "0"
|
33
|
-
type: :
|
32
|
+
type: :runtime
|
34
33
|
version_requirements: *id001
|
35
34
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
35
|
+
name: redline
|
37
36
|
prerelease: false
|
38
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
38
|
none: false
|
@@ -46,6 +45,20 @@ dependencies:
|
|
46
45
|
version: "0"
|
47
46
|
type: :development
|
48
47
|
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: qed
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
type: :development
|
61
|
+
version_requirements: *id003
|
49
62
|
description: Assertive Expressive is an assertions library specifically designed for reuse by other test frameworks.
|
50
63
|
email: transfire@gmail.com
|
51
64
|
executables: []
|
@@ -87,9 +100,7 @@ files:
|
|
87
100
|
- HISTORY.rdoc
|
88
101
|
- APACHE2.txt
|
89
102
|
- README.rdoc
|
90
|
-
- Redfile
|
91
103
|
- NOTICE.rdoc
|
92
|
-
has_rdoc: true
|
93
104
|
homepage: http://rubyworks.github.com/ae
|
94
105
|
licenses:
|
95
106
|
- Apache 2.0
|
@@ -122,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
133
|
requirements: []
|
123
134
|
|
124
135
|
rubyforge_project: ae
|
125
|
-
rubygems_version: 1.
|
136
|
+
rubygems_version: 1.8.2
|
126
137
|
signing_key:
|
127
138
|
specification_version: 3
|
128
139
|
summary: Assertive Expressive
|
data/Redfile
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
---
|
2
|
-
gem:
|
3
|
-
service: Gem
|
4
|
-
active : true
|
5
|
-
|
6
|
-
dnote:
|
7
|
-
service : DNote
|
8
|
-
loadpath : ~
|
9
|
-
labels : ~
|
10
|
-
output : ~
|
11
|
-
format : ~
|
12
|
-
active : true
|
13
|
-
|
14
|
-
stats:
|
15
|
-
service : Stats
|
16
|
-
title : ~
|
17
|
-
loadpath : ~
|
18
|
-
exclude : ~
|
19
|
-
output : ~
|
20
|
-
active : true
|
21
|
-
|
22
|
-
rdoc:
|
23
|
-
service : rdoc
|
24
|
-
format : redfish
|
25
|
-
exclude : [Redfile, Profile, MANIFEST, Version]
|
26
|
-
output : site/doc/api
|
27
|
-
|
28
|
-
ri:
|
29
|
-
service: RI
|
30
|
-
include: ~
|
31
|
-
exclude: ~
|
32
|
-
output : .ri
|
33
|
-
active : true
|
34
|
-
|
35
|
-
qedoc:
|
36
|
-
service: custom
|
37
|
-
cycle: main
|
38
|
-
document: |
|
39
|
-
puts `qedoc -o site/doc/qed -t "AE Demonstrandum" qed`
|
40
|
-
|
41
|
-
testrb:
|
42
|
-
service : testrb
|
43
|
-
tests : ~
|
44
|
-
exclude : ~
|
45
|
-
loadpath : ~
|
46
|
-
requires : ~
|
47
|
-
live : false
|
48
|
-
active : false
|
49
|
-
|
50
|
-
grancher:
|
51
|
-
service: Grancher
|
52
|
-
active: true
|
53
|
-
#sitemap:
|
54
|
-
# - site
|
55
|
-
# - [doc/rdoc, rdoc]
|
56
|
-
# - [doc/qedoc, qedoc]
|
57
|
-
|
58
|
-
gemcutter:
|
59
|
-
active: true
|
60
|
-
|
61
|
-
email:
|
62
|
-
service : Email
|
63
|
-
file : ~
|
64
|
-
subject : ~
|
65
|
-
mailto : ruby-talk@ruby-lang.org
|
66
|
-
# from : transfire@gmail.com
|
67
|
-
# server : <%= ENV['EMAIL_SERVER'] %>
|
68
|
-
# port : <%= ENV['EMAIL_PORT'] %>
|
69
|
-
# account : <%= ENV['EMAIL_ACCOUNT'] %>
|
70
|
-
# domain : <%= ENV['EMAIL_DOMAIN'] %>
|
71
|
-
# login : <%= ENV['EMAIL_LOGIN'] %>
|
72
|
-
# secure : <%= ENV['EMAIL_SECURE'] %>
|
73
|
-
active : true
|
74
|
-
|
75
|
-
vclog:
|
76
|
-
service : VClog
|
77
|
-
format : html # xml, txt
|
78
|
-
layout : rel # gnu
|
79
|
-
typed : false
|
80
|
-
output : ~
|
81
|
-
active : false
|
82
|
-
|