diff --git a/Rakefile b/Rakefile index 05aca9e9..22f8e6e1 100644 --- a/Rakefile +++ b/Rakefile @@ -31,7 +31,7 @@ def apply_spec_defaults(s) end task :test do - sh "bacon #{direc}/test/test.rb" + sh "bacon -Itest -rubygems test/test.rb" end desc "run pry" diff --git a/test/test.rb b/test/test.rb index fa4fd662..c212e25c 100644 --- a/test/test.rb +++ b/test/test.rb @@ -1,11 +1,4 @@ -direc = File.dirname(__FILE__) - -$LOAD_PATH.unshift "#{direc}/../lib" - -require 'rubygems' -require 'bacon' -require "pry" -require "#{direc}/test_helper" +require 'test_helper' puts "Ruby Version #{RUBY_VERSION}" puts "Testing Pry #{Pry::VERSION}" @@ -135,7 +128,7 @@ describe Pry do it "should run the rc file only once" do Pry.should_load_rc = true - Pry::RC_FILES << "#{direc}/testrc" + Pry::RC_FILES << File.expand_path("../testrc", __FILE__) Pry.start(self, :input => StringIO.new("exit\n"), :output => Pry::NullOutput) TEST_RC.should == [0] diff --git a/test/test_helper.rb b/test/test_helper.rb index 351e3d90..67594c19 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,10 @@ +unless Object.const_defined? 'Pry' + $:.unshift File.expand_path '../../lib', __FILE__ + require 'pry' +end + +require 'bacon' + # Ensure we do not execute any rc files Pry::RC_FILES.clear Pry.color = false