mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
simplify test running
do not require rubygems inside tests shift test into load path move test logic into helper so any new tests just require this helper and can also be run independently
This commit is contained in:
parent
32326cd05c
commit
fad6cf9977
3 changed files with 10 additions and 10 deletions
2
Rakefile
2
Rakefile
|
@ -31,7 +31,7 @@ def apply_spec_defaults(s)
|
||||||
end
|
end
|
||||||
|
|
||||||
task :test do
|
task :test do
|
||||||
sh "bacon #{direc}/test/test.rb"
|
sh "bacon -Itest -rubygems test/test.rb"
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "run pry"
|
desc "run pry"
|
||||||
|
|
11
test/test.rb
11
test/test.rb
|
@ -1,11 +1,4 @@
|
||||||
direc = File.dirname(__FILE__)
|
require 'test_helper'
|
||||||
|
|
||||||
$LOAD_PATH.unshift "#{direc}/../lib"
|
|
||||||
|
|
||||||
require 'rubygems'
|
|
||||||
require 'bacon'
|
|
||||||
require "pry"
|
|
||||||
require "#{direc}/test_helper"
|
|
||||||
|
|
||||||
puts "Ruby Version #{RUBY_VERSION}"
|
puts "Ruby Version #{RUBY_VERSION}"
|
||||||
puts "Testing Pry #{Pry::VERSION}"
|
puts "Testing Pry #{Pry::VERSION}"
|
||||||
|
@ -135,7 +128,7 @@ describe Pry do
|
||||||
|
|
||||||
it "should run the rc file only once" do
|
it "should run the rc file only once" do
|
||||||
Pry.should_load_rc = true
|
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)
|
Pry.start(self, :input => StringIO.new("exit\n"), :output => Pry::NullOutput)
|
||||||
TEST_RC.should == [0]
|
TEST_RC.should == [0]
|
||||||
|
|
|
@ -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
|
# Ensure we do not execute any rc files
|
||||||
Pry::RC_FILES.clear
|
Pry::RC_FILES.clear
|
||||||
Pry.color = false
|
Pry.color = false
|
||||||
|
|
Loading…
Reference in a new issue