1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Move all fixtures into fixtures/

This commit is contained in:
Ryan Fitzgerald 2012-12-09 11:42:41 -08:00
parent e0bebb831d
commit cbf19cc7a4
10 changed files with 11 additions and 13 deletions

View file

@ -50,7 +50,7 @@ task :test do
check_dependencies unless ENV['SKIP_DEP_CHECK'] check_dependencies unless ENV['SKIP_DEP_CHECK']
all_specs = Dir['spec/**/*_spec.rb'] all_specs = Dir['spec/**/*_spec.rb']
all_specs.shuffle! if all_specs.respond_to? :shuffle! all_specs.shuffle! if all_specs.respond_to? :shuffle!
system "bacon -Ispec -rubygems -a -q #{all_specs.join ' '}" system "bacon -Ispec -rubygems -q #{all_specs.join ' '}"
end end
task :spec => :test task :spec => :test

View file

View file

@ -6,9 +6,8 @@ end
require 'mocha/api' require 'mocha/api'
require 'pry/test/helper' require 'pry/test/helper'
require 'helpers/bacon'
require File.expand_path('../helpers/bacon', __FILE__) require 'helpers/mock_pry'
require File.expand_path('../helpers/mock_pry', __FILE__)
class Module class Module
public :remove_const public :remove_const

View file

@ -276,7 +276,7 @@ OUTPUT
end end
describe "nesting" do describe "nesting" do
test = File.read("spec/example_nesting.rb") test = File.read("spec/fixtures/example_nesting.rb")
test.lines.each_with_index do |line, i| test.lines.each_with_index do |line, i|
result = line.split("#").last.strip result = line.split("#").last.strip

View file

@ -307,8 +307,8 @@ describe Pry do
describe "test loading rc files" do describe "test loading rc files" do
before do before do
Pry::HOME_RC_FILE.replace File.expand_path("../testrc", __FILE__) Pry::HOME_RC_FILE.replace "spec/fixtures/testrc"
Pry::LOCAL_RC_FILE.replace File.expand_path("../testrc", __FILE__) + "/../testrc" Pry::LOCAL_RC_FILE.replace "spec/fixtures/testrc/../testrc"
Pry.instance_variable_set(:@initial_session, true) Pry.instance_variable_set(:@initial_session, true)
end end
@ -355,7 +355,7 @@ describe Pry do
describe "that raise exceptions" do describe "that raise exceptions" do
before do before do
Pry::HOME_RC_FILE = File.expand_path("../testrcbad", __FILE__) Pry::HOME_RC_FILE = "spec/fixtures/testrcbad"
Pry.config.should_load_rc = true Pry.config.should_load_rc = true
Pry.config.should_load_local_rc = false Pry.config.should_load_local_rc = false
@ -390,7 +390,8 @@ describe Pry do
end end
it "should output an error" do it "should output an error" do
@doing_it[].should =~ /Error loading #{File.expand_path("../testrcbad", __FILE__)}: messin with ya/ @doing_it.call.should ==
"Error loading spec/fixtures/testrcbad: messin with ya"
end end
end end
end end

View file

@ -11,10 +11,8 @@ describe Pry::WrappedModule do
describe "candidates" do describe "candidates" do
before do before do
class Host class Host
source_files = [File.join(File.dirname(__FILE__), "candidate_helper1.rb"), %w(spec/fixtures/candidate_helper1.rb
File.join(File.dirname(__FILE__), "candidate_helper2.rb")] spec/fixtures/candidate_helper2.rb).each do |file|
source_files.each do |file|
binding.eval File.read(file), file, 1 binding.eval File.read(file), file, 1
end end