Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 37 lines (28 sloc) 1.039 kb
0400c67 @grosser make all tests runnable via ruby test_file.rb by loading the helper abso...
grosser authored
1 require File.expand_path '../helper', __FILE__
a4dcaf5 @jferris Separating Rails functionality out more
jferris authored
2
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
3 require 'airbrake/rails'
2aed3e2 @joshuaclayton Initial implementation of logger
joshuaclayton authored
4
4cac54c @joshuaclayton RailsInit => RailsInitializer
joshuaclayton authored
5 class RailsInitializerTest < Test::Unit::TestCase
2aed3e2 @joshuaclayton Initial implementation of logger
joshuaclayton authored
6 include DefinesConstants
7
8 should "trigger use of Rails' logger if logger isn't set and Rails' logger exists" do
9 rails = Module.new do
10 def self.logger
11 "RAILS LOGGER"
12 end
13 end
14 define_constant("Rails", rails)
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
15 Airbrake::Rails.initialize
16 assert_equal "RAILS LOGGER", Airbrake.logger
2aed3e2 @joshuaclayton Initial implementation of logger
joshuaclayton authored
17 end
18
19 should "trigger use of Rails' default logger if logger isn't set and Rails.logger doesn't exist" do
20 define_constant("RAILS_DEFAULT_LOGGER", "RAILS DEFAULT LOGGER")
21
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
22 Airbrake::Rails.initialize
23 assert_equal "RAILS DEFAULT LOGGER", Airbrake.logger
2aed3e2 @joshuaclayton Initial implementation of logger
joshuaclayton authored
24 end
d0c8d7b @joshuaclayton Fix test name and add the right require
joshuaclayton authored
25
26 should "allow overriding of the logger if already assigned" do
27 define_constant("RAILS_DEFAULT_LOGGER", "RAILS DEFAULT LOGGER")
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
28 Airbrake::Rails.initialize
d0c8d7b @joshuaclayton Fix test name and add the right require
joshuaclayton authored
29
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
30 Airbrake.configure(true) do |config|
d0c8d7b @joshuaclayton Fix test name and add the right require
joshuaclayton authored
31 config.logger = "OVERRIDDEN LOGGER"
32 end
33
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
34 assert_equal "OVERRIDDEN LOGGER", Airbrake.logger
d0c8d7b @joshuaclayton Fix test name and add the right require
joshuaclayton authored
35 end
2aed3e2 @joshuaclayton Initial implementation of logger
joshuaclayton authored
36 end
Something went wrong with that request. Please try again.