Skip to content
This repository
Browse code

RUBY-945 Fix rake unit test runner in 1.9.2

1.9.2 comes with a build in version of rake 0.8.7 which was being
required too early and causing problems when run in the bundled
environment.
  • Loading branch information...
commit 98042f4d96a8ff7ab8a200c8d5f415f506696881 1 parent 83fee2c
Sam Goldstein authored November 13, 2012
1  Gemfile
@@ -5,7 +5,6 @@ group :development do
5 5
   # There's problems with the test task in rake 10
6 6
   # https://github.com/jimweirich/rake/issues/144
7 7
   gem 'rake', '0.9.2.2'
8  
-  require 'rake'
9 8
   gem 'mocha', '~>0.12.0'
10 9
   gem 'shoulda', '~>3.0.1'
11 10
   gem 'sdoc-helpers'
5  Rakefile
... ...
@@ -1,12 +1,7 @@
1 1
 require 'rubygems'
2 2
 require "#{File.dirname(__FILE__)}/lib/new_relic/version.rb"
3  
-require 'rake/testtask'
4  
-
5 3
 require "#{File.dirname(__FILE__)}/lib/tasks/all.rb"
6 4
 
7  
-task :test => Rake::Task['test:newrelic']
8  
-
9  
-task :default => :test
10 5
 
11 6
 desc 'Generate gemspec [ build_number, stage ]'
12 7
 task :gemspec, [ :build_number, :stage ] do |t, args|
7  lib/tasks/tests.rake
... ...
@@ -1,12 +1,13 @@
1  
-# run unit tests for the NewRelic Agent
2 1
 begin
3  
-  require 'rake/test_task'
  2
+  require 'rake/testtask'
4 3
 rescue LoadError => e
5 4
 end
6 5
 
7 6
 if defined? Rake::TestTask
  7
+  task :test => 'test:newrelic'
  8
+  task :default => :test
8 9
   namespace :test do
9  
-    AGENT_HOME = File.expand_path(File.join(File.dirname(__FILE__), "..",".."))
  10
+    AGENT_HOME = File.expand_path(File.join(File.dirname(__FILE__),'..','..'))
10 11
     Rake::TestTask.new(:newrelic) do |t|
11 12
       t.libs << "#{AGENT_HOME}/test"
12 13
       t.libs << "#{AGENT_HOME}/lib"

0 notes on commit 98042f4

Please sign in to comment.
Something went wrong with that request. Please try again.