1
- require File . expand_path ( File . join ( File . dirname ( __FILE__ ) , '/../../test_helper' ) )
2
-
3
- class NewRelic ::Control ::ConfigurationTest < Test ::Unit ::TestCase
4
- require 'new_relic/control/configuration'
5
- include NewRelic ::Control ::Configuration
6
-
7
- def setup
8
- # The log stuff is memoized so let's clear it each time.
9
- NewRelic ::Control . instance . instance_variable_set '@log_path' , nil
10
- NewRelic ::Control . instance . instance_variable_set '@log_file' , nil
11
- @root = ::Rails ::VERSION ::MAJOR == 3 ? Rails . root : RAILS_ROOT
12
- end
13
-
14
- def test_log_path_uses_default_if_not_set
15
- NewRelic ::Control . instance . setup_log
16
- assert_match ( /log\/ newrelic_agent.log$/ ,
17
- NewRelic ::Control . instance . log_file )
18
- end
19
-
20
- def test_log_file_path_uses_given_value
21
- Dir . stubs ( :mkdir ) . returns ( true )
22
- with_config ( :log_file_path => 'lerg' ) do
23
- NewRelic ::Control . instance . setup_log
24
- assert_match ( /\/ lerg\/ newrelic_agent.log$/ ,
25
- NewRelic ::Control . instance . log_file )
26
- end
27
- end
1
+ require File . expand_path ( File . join ( File . dirname ( __FILE__ ) , '/../../../test_helper' ) )
28
2
3
+ class NewRelic ::Control ::Frameworks ::RailsTest < Test ::Unit ::TestCase
29
4
def test_install_browser_monitoring
30
5
require ( File . expand_path ( File . join ( File . dirname ( __FILE__ ) ,
31
- '/../../../lib/new_relic/rack/browser_monitoring' ) ) )
6
+ '/../../../../ lib/new_relic/rack/browser_monitoring' ) ) )
32
7
middleware = stub ( 'middleware config' )
33
8
config = stub ( 'rails config' , :middleware => middleware )
34
9
middleware . expects ( :use ) . with ( NewRelic ::Rack ::BrowserMonitoring )
@@ -43,7 +18,7 @@ def test_install_browser_monitoring_should_not_install_when_not_configured
43
18
config = stub ( 'rails config' , :middleware => middleware )
44
19
middleware . expects ( :use ) . never
45
20
NewRelic ::Control . instance . instance_eval { @browser_monitoring_installed = false }
46
-
21
+
47
22
with_config ( :'browser_monitoring.auto_instrument' => false ) do
48
23
NewRelic ::Control . instance . install_browser_monitoring ( config )
49
24
end
0 commit comments