test/test_helper.rb in newrelic_rpm-2.14.1 vs test/test_helper.rb in newrelic_rpm-3.0.0.beta1
- old
+ new
@@ -7,21 +7,21 @@
$LOAD_PATH << File.join(NEWRELIC_PLUGIN_DIR,"ui/helpers")
$LOAD_PATH.uniq!
require 'rubygems'
# We can speed things up in tests that don't need to load rails.
-# You can also run the tests in a mode without rails. Many tests
+# You can also run the tests in a mode without rails. Many tests
# will be skipped.
begin
require 'config/environment'
begin
require 'test_help'
rescue LoadError
# ignore load problems on test help - it doesn't exist in rails 3
end
-
+
rescue LoadError
puts "Unable to load Rails for New Relic tests"
raise
end
require 'newrelic_rpm'
@@ -119,18 +119,18 @@
def make_sql_transaction(*sql)
sampler = NewRelic::Agent::TransactionSampler.new
sampler.notice_first_scope_push Time.now.to_f
sampler.notice_transaction '/path', nil, :jim => "cool"
sampler.notice_push_scope "a"
-
+
sampler.notice_transaction '/path/2', nil, :jim => "cool"
-
+
sql.each {|sql_statement| sampler.notice_sql(sql_statement, {:adapter => "test"}, 0 ) }
-
+
sleep 1.0
yield if block_given?
sampler.notice_pop_scope "a"
sampler.notice_scope_empty
-
+
sampler.samples[0]
end
end