fiveruns-dash-ruby 0.8.1 → 0.8.3

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.
@@ -9,7 +9,6 @@ module Fiveruns::Dash
9
9
  end
10
10
 
11
11
  def self.default_options
12
- ::Fiveruns::Dash.logger.info "CWD::#{Dir.pwd.inspect}"
13
12
  {:scm_repo => Dir.pwd}
14
13
  end
15
14
 
@@ -11,6 +11,7 @@ module Fiveruns::Dash
11
11
  end
12
12
 
13
13
  def start(background = true, &block)
14
+ Fiveruns::Dash.logger.info "Starting Dash #{Fiveruns::Dash::Util.version_info}"
14
15
  reporter.start(background, &block)
15
16
  end
16
17
 
@@ -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
@@ -3,6 +3,7 @@ require 'json'
3
3
 
4
4
  require 'pathname'
5
5
  require 'thread'
6
+ require 'time'
6
7
  require 'logger'
7
8
 
8
9
  $:.unshift(File.dirname(__FILE__))
@@ -15,14 +15,44 @@ class ExceptionRecorderTest < Test::Unit::TestCase
15
15
  end
16
16
 
17
17
  context "when recording an exception" do
18
- setup do
19
- recorder.record(build("Message", "foo/bar/baz"))
20
- end
21
- should "record an exception" do
22
- assert_equal 1, recorder.data.size
23
- end
24
- should "normalize a backtrace" do
25
- assert(recorder.data.first[:backtrace] =~ /\[FOO\]/)
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
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 8
4
- :patch: 1
4
+ :patch: 3
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.1
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-18 00:00:00 -08:00
12
+ date: 2009-02-26 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency