fiveruns-dash-ruby 0.8.1 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fiveruns/dash/configuration.rb +0 -1
- data/lib/fiveruns/dash/session.rb +1 -0
- data/lib/fiveruns/dash/util.rb +7 -0
- data/lib/fiveruns/dash.rb +1 -0
- data/test/exception_recorder_test.rb +53 -8
- data/version.yml +1 -1
- metadata +2 -2
data/lib/fiveruns/dash/util.rb
CHANGED
@@ -65,6 +65,13 @@ module Fiveruns::Dash
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
def self.version_info
|
69
|
+
if defined?(Gem)
|
70
|
+
"with gems #{Gem.loaded_specs.values.find_all {|spec| spec.name =~ /fiveruns-dash/ }.map {|spec| "#{spec.name}-#{spec.version}"}.inspect}"
|
71
|
+
else
|
72
|
+
Fiveruns::Dash::Version::STRING
|
73
|
+
end
|
74
|
+
end
|
68
75
|
end
|
69
76
|
|
70
77
|
end
|
data/lib/fiveruns/dash.rb
CHANGED
@@ -15,14 +15,44 @@ class ExceptionRecorderTest < Test::Unit::TestCase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
context "when recording an exception" do
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
context "when not ignored" do
|
19
|
+
setup do
|
20
|
+
recorder.record(build("Message", "foo/bar/baz"))
|
21
|
+
end
|
22
|
+
should "record an exception" do
|
23
|
+
assert_equal 1, recorder.data.size
|
24
|
+
end
|
25
|
+
should "normalize a backtrace" do
|
26
|
+
assert(recorder.data.first[:backtrace] =~ /\[FOO\]/)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
context "when ignored" do
|
30
|
+
context "checking in the right order" do
|
31
|
+
setup do
|
32
|
+
mock_ignore!(true)
|
33
|
+
Fiveruns::Dash::ExceptionRecorder.add_ignore_rule do |e|
|
34
|
+
e.message == 'Message'
|
35
|
+
end
|
36
|
+
recorder.record(build("Message", "foo/bar/baz"))
|
37
|
+
end
|
38
|
+
teardown { Fiveruns::Dash::ExceptionRecorder::RULES.clear }
|
39
|
+
should "not extract data from exception" do
|
40
|
+
assert_equal [:check], @steps
|
41
|
+
end
|
42
|
+
end
|
43
|
+
context "recording" do
|
44
|
+
setup do
|
45
|
+
Fiveruns::Dash::ExceptionRecorder.add_ignore_rule do |e|
|
46
|
+
e.message == 'Message'
|
47
|
+
end
|
48
|
+
recorder.record(build("Message", "foo/bar/baz"))
|
49
|
+
end
|
50
|
+
teardown { Fiveruns::Dash::ExceptionRecorder::RULES.clear }
|
51
|
+
should "not record" do
|
52
|
+
assert_equal 0, recorder.data.size
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
26
56
|
end
|
27
57
|
end
|
28
58
|
|
@@ -102,6 +132,21 @@ class ExceptionRecorderTest < Test::Unit::TestCase
|
|
102
132
|
#######
|
103
133
|
private
|
104
134
|
#######
|
135
|
+
|
136
|
+
def mock_ignore!(ignore)
|
137
|
+
@steps = []
|
138
|
+
flexmock(@recorder) do |mock|
|
139
|
+
mock.should_receive(:ignore_exception?).and_return do |mock|
|
140
|
+
@steps << :check
|
141
|
+
ignore
|
142
|
+
end
|
143
|
+
mock.should_receive(:extract_data_from_exception).and_return do
|
144
|
+
@steps << :extracted
|
145
|
+
{}
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
105
150
|
|
106
151
|
def build(message = 'This is a message', line = 'backtrace line')
|
107
152
|
flexmock(:exception) do |mock|
|
data/version.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fiveruns-dash-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FiveRuns Development Team
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-02-
|
12
|
+
date: 2009-02-26 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|