exception_notification 2.6.1 → 3.0.0.rc1

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.
Files changed (30) hide show
  1. data/CHANGELOG.rdoc +12 -0
  2. data/CONTRIBUTING.md +33 -0
  3. data/Gemfile.lock +61 -33
  4. data/README.md +59 -12
  5. data/exception_notification.gemspec +5 -3
  6. data/lib/exception_notifier.rb +7 -0
  7. data/lib/exception_notifier/campfire_notifier.rb +30 -0
  8. data/lib/exception_notifier/notifier.rb +55 -26
  9. data/lib/exception_notifier/views/exception_notifier/_backtrace.html.erb +1 -0
  10. data/lib/exception_notifier/views/exception_notifier/_data.html.erb +1 -0
  11. data/lib/exception_notifier/views/exception_notifier/_environment.html.erb +8 -0
  12. data/lib/exception_notifier/views/exception_notifier/_request.html.erb +5 -0
  13. data/lib/exception_notifier/views/exception_notifier/_session.html.erb +2 -0
  14. data/lib/exception_notifier/views/exception_notifier/_title.html.erb +3 -0
  15. data/lib/exception_notifier/views/exception_notifier/background_exception_notification.html.erb +26 -0
  16. data/lib/exception_notifier/views/exception_notifier/background_exception_notification.text.erb +5 -3
  17. data/lib/exception_notifier/views/exception_notifier/exception_notification.html.erb +36 -0
  18. data/lib/exception_notifier/views/exception_notifier/exception_notification.text.erb +4 -3
  19. data/test/background_exception_notification_test.rb +21 -6
  20. data/test/campfire_test.rb +52 -0
  21. data/test/dummy/Gemfile +1 -1
  22. data/test/dummy/Gemfile.lock +93 -58
  23. data/test/dummy/app/controllers/posts_controller.rb +1 -0
  24. data/test/dummy/app/views/exception_notifier/_new_bkg_section.html.erb +1 -0
  25. data/test/dummy/app/views/exception_notifier/_new_section.html.erb +1 -0
  26. data/test/dummy/app/views/exception_notifier/_new_section.text.erb +1 -1
  27. data/test/dummy/test/functional/posts_controller_test.rb +62 -10
  28. data/test/exception_notification_test.rb +27 -2
  29. data/test/test_helper.rb +3 -0
  30. metadata +55 -7
@@ -5,20 +5,41 @@ class ExceptionNotificationTest < ActiveSupport::TestCase
5
5
  assert ExceptionNotifier.default_ignore_exceptions == ['ActiveRecord::RecordNotFound', 'AbstractController::ActionNotFound', 'ActionController::RoutingError']
6
6
  end
7
7
 
8
- test "should have default sender address overriden" do
8
+ test "should have default sender address overridden" do
9
9
  assert ExceptionNotifier::Notifier.default_sender_address == %("Dummy Notifier" <dummynotifier@example.com>)
10
10
  end
11
11
 
12
- test "should have default email prefix overriden" do
12
+ test "should have default email prefix overridden" do
13
13
  assert ExceptionNotifier::Notifier.default_email_prefix == "[Dummy ERROR] "
14
14
  end
15
15
 
16
+ test "should have default email format overridden" do
17
+ assert ExceptionNotifier::Notifier.default_email_format == :text
18
+ end
19
+
16
20
  test "should have default sections" do
17
21
  for section in %w(request session environment backtrace)
18
22
  assert ExceptionNotifier::Notifier.default_sections.include? section
19
23
  end
20
24
  end
21
25
 
26
+ test "should have default section overridden" do
27
+ begin
28
+ test_string = '--- this is a test ---'
29
+ env = {}
30
+ exception = StandardError.new("Test Error")
31
+ options = {:sections => %w(environment)}
32
+
33
+ section_partial = Rails.root.join('app', 'views', 'exception_notifier', '_environment.text.erb')
34
+
35
+ File.open(section_partial, 'w+') { |f| f.puts test_string }
36
+
37
+ assert ExceptionNotifier::Notifier.exception_notification(env, exception, options).body =~ /#{test_string}/
38
+ ensure
39
+ File.delete section_partial
40
+ end
41
+ end
42
+
22
43
  test "should have default background sections" do
23
44
  for section in %w(backtrace data)
24
45
  assert ExceptionNotifier::Notifier.default_background_sections.include? section
@@ -41,4 +62,8 @@ class ExceptionNotificationTest < ActiveSupport::TestCase
41
62
  test "should have normalize_subject false by default" do
42
63
  assert ExceptionNotifier::Notifier.default_options[:normalize_subject] == false
43
64
  end
65
+
66
+ test "should have smtp_settings nil by default" do
67
+ assert ExceptionNotifier::Notifier.default_options[:smtp_settings] == nil
68
+ end
44
69
  end
@@ -5,4 +5,7 @@ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
5
  require "rails/test_help"
6
6
  require File.expand_path("../dummy/test/test_helper.rb", __FILE__)
7
7
 
8
+ require "test/unit"
9
+ require "mocha"
10
+
8
11
  Rails.backtrace_cleaner.remove_silencers!
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_notification
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
5
- prerelease:
4
+ version: 3.0.0.rc1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jamis Buck
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-04-21 00:00:00.000000000 Z
13
+ date: 2012-10-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionmailer
@@ -28,6 +28,22 @@ dependencies:
28
28
  - - ! '>='
29
29
  - !ruby/object:Gem::Version
30
30
  version: 3.0.4
31
+ - !ruby/object:Gem::Dependency
32
+ name: tinder
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ~>
37
+ - !ruby/object:Gem::Version
38
+ version: '1.8'
39
+ type: :runtime
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '1.8'
31
47
  - !ruby/object:Gem::Dependency
32
48
  name: rails
33
49
  requirement: !ruby/object:Gem::Requirement
@@ -44,6 +60,22 @@ dependencies:
44
60
  - - ! '>='
45
61
  - !ruby/object:Gem::Version
46
62
  version: 3.0.4
63
+ - !ruby/object:Gem::Dependency
64
+ name: mocha
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: 0.11.3
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: 0.11.3
47
79
  - !ruby/object:Gem::Dependency
48
80
  name: sqlite3
49
81
  requirement: !ruby/object:Gem::Requirement
@@ -68,6 +100,7 @@ extra_rdoc_files: []
68
100
  files:
69
101
  - .gemtest
70
102
  - CHANGELOG.rdoc
103
+ - CONTRIBUTING.md
71
104
  - Gemfile
72
105
  - Gemfile.lock
73
106
  - README.md
@@ -75,16 +108,26 @@ files:
75
108
  - exception_notification.gemspec
76
109
  - lib/exception_notification.rb
77
110
  - lib/exception_notifier.rb
111
+ - lib/exception_notifier/campfire_notifier.rb
78
112
  - lib/exception_notifier/notifier.rb
113
+ - lib/exception_notifier/views/exception_notifier/_backtrace.html.erb
79
114
  - lib/exception_notifier/views/exception_notifier/_backtrace.text.erb
115
+ - lib/exception_notifier/views/exception_notifier/_data.html.erb
80
116
  - lib/exception_notifier/views/exception_notifier/_data.text.erb
117
+ - lib/exception_notifier/views/exception_notifier/_environment.html.erb
81
118
  - lib/exception_notifier/views/exception_notifier/_environment.text.erb
119
+ - lib/exception_notifier/views/exception_notifier/_request.html.erb
82
120
  - lib/exception_notifier/views/exception_notifier/_request.text.erb
121
+ - lib/exception_notifier/views/exception_notifier/_session.html.erb
83
122
  - lib/exception_notifier/views/exception_notifier/_session.text.erb
123
+ - lib/exception_notifier/views/exception_notifier/_title.html.erb
84
124
  - lib/exception_notifier/views/exception_notifier/_title.text.erb
125
+ - lib/exception_notifier/views/exception_notifier/background_exception_notification.html.erb
85
126
  - lib/exception_notifier/views/exception_notifier/background_exception_notification.text.erb
127
+ - lib/exception_notifier/views/exception_notifier/exception_notification.html.erb
86
128
  - lib/exception_notifier/views/exception_notifier/exception_notification.text.erb
87
129
  - test/background_exception_notification_test.rb
130
+ - test/campfire_test.rb
88
131
  - test/dummy/.gitignore
89
132
  - test/dummy/Gemfile
90
133
  - test/dummy/Gemfile.lock
@@ -94,7 +137,9 @@ files:
94
137
  - test/dummy/app/helpers/application_helper.rb
95
138
  - test/dummy/app/helpers/posts_helper.rb
96
139
  - test/dummy/app/models/post.rb
140
+ - test/dummy/app/views/exception_notifier/_new_bkg_section.html.erb
97
141
  - test/dummy/app/views/exception_notifier/_new_bkg_section.text.erb
142
+ - test/dummy/app/views/exception_notifier/_new_section.html.erb
98
143
  - test/dummy/app/views/exception_notifier/_new_section.text.erb
99
144
  - test/dummy/app/views/layouts/application.html.erb
100
145
  - test/dummy/app/views/posts/_form.html.erb
@@ -155,17 +200,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
200
  required_rubygems_version: !ruby/object:Gem::Requirement
156
201
  none: false
157
202
  requirements:
158
- - - ! '>='
203
+ - - ! '>'
159
204
  - !ruby/object:Gem::Version
160
- version: '0'
205
+ version: 1.3.1
161
206
  requirements: []
162
207
  rubyforge_project:
163
- rubygems_version: 1.8.21
208
+ rubygems_version: 1.8.23
164
209
  signing_key:
165
210
  specification_version: 3
166
- summary: Exception notification by email for Rails apps
211
+ summary: Exception notification for Rails apps
167
212
  test_files:
168
213
  - test/background_exception_notification_test.rb
214
+ - test/campfire_test.rb
169
215
  - test/dummy/.gitignore
170
216
  - test/dummy/Gemfile
171
217
  - test/dummy/Gemfile.lock
@@ -175,7 +221,9 @@ test_files:
175
221
  - test/dummy/app/helpers/application_helper.rb
176
222
  - test/dummy/app/helpers/posts_helper.rb
177
223
  - test/dummy/app/models/post.rb
224
+ - test/dummy/app/views/exception_notifier/_new_bkg_section.html.erb
178
225
  - test/dummy/app/views/exception_notifier/_new_bkg_section.text.erb
226
+ - test/dummy/app/views/exception_notifier/_new_section.html.erb
179
227
  - test/dummy/app/views/exception_notifier/_new_section.text.erb
180
228
  - test/dummy/app/views/layouts/application.html.erb
181
229
  - test/dummy/app/views/posts/_form.html.erb