quietbacktrace 0.0.1 → 0.0.2
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/History.txt +4 -0
- data/README.txt +12 -2
- data/Rakefile +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -15,6 +15,9 @@ By default, their values are:
|
|
15
15
|
self.backtrace_silencers = [:test_unit, :gem_root, :e1]
|
16
16
|
self.backtrace_filters = [:method_name]
|
17
17
|
|
18
|
+
Silencers remove lines from the backtrace that return true for given conditions.
|
19
|
+
Filters modify the output of backtrace lines.
|
20
|
+
|
18
21
|
Override the defaults by adding your own backtrace_silencers:
|
19
22
|
class Test::Unit::TestCase
|
20
23
|
self.backtrace_silencers :shoulda do |line|
|
@@ -22,7 +25,7 @@ Override the defaults by adding your own backtrace_silencers:
|
|
22
25
|
end
|
23
26
|
end
|
24
27
|
|
25
|
-
|
28
|
+
Or your own backtrace_filters:
|
26
29
|
class Test::Unit::TestCase
|
27
30
|
self.backtrace_filters :ruby_path do |line|
|
28
31
|
ruby_file_path = '/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8'
|
@@ -30,6 +33,9 @@ Adding your own backtrace_filters works the same way:
|
|
30
33
|
end
|
31
34
|
end
|
32
35
|
|
36
|
+
Turn Quiet Backtrace off anywhere in your test suite by setting the flag to false:
|
37
|
+
Test::Unit::TestCase.quiet_backtrace = false
|
38
|
+
|
33
39
|
== Rails-specific usage
|
34
40
|
|
35
41
|
If you're working with Rails, you must add the built-in silencer
|
@@ -39,6 +45,10 @@ and filter because they are not turned on by default:
|
|
39
45
|
self.backtrace_filters << :rails_root
|
40
46
|
end
|
41
47
|
|
48
|
+
Because Quiet Backtrace works by adding attributes onto Test::Unit::TestCase,
|
49
|
+
you can add and remove silencers and filters at any level in your test suite,
|
50
|
+
down to the individual test.
|
51
|
+
|
42
52
|
== Resources
|
43
53
|
|
44
54
|
* mailing list: http://groups.google.com/group/quiet_backtrace
|
@@ -61,7 +71,7 @@ for cultivating this idea at our inaugural hackfest.
|
|
61
71
|
are included in the gem. They allow quiet_backtrace.rb to use alias_method_chain,
|
62
72
|
cattr_accessor, and mattr_accessor.
|
63
73
|
|
64
|
-
==
|
74
|
+
== Copyright
|
65
75
|
|
66
76
|
Copyright (c) 2007 Dan Croak, thoughtbot, inc., released under the MIT license
|
67
77
|
|
data/Rakefile
CHANGED
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: quietbacktrace
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
6
|
+
version: 0.0.2
|
7
7
|
date: 2007-12-03 00:00:00 -05:00
|
8
8
|
summary: quiet_backtrace suppresses the noise in your Test::Unit backtrace. It also provides hooks for you to add additional filters.
|
9
9
|
require_paths:
|