2014-03-14 03:00:48 -04:00
|
|
|
require 'bundler/setup'
|
2014-03-14 00:31:24 -04:00
|
|
|
require 'pry/test/helper'
|
2014-03-14 20:47:58 -04:00
|
|
|
Bundler.require :default, :test
|
2014-03-14 00:31:24 -04:00
|
|
|
require_relative 'spec_helpers/mock_pry'
|
|
|
|
require_relative 'spec_helpers/repl_tester'
|
|
|
|
|
2014-05-30 16:43:25 -04:00
|
|
|
if ENV["COVERAGE"]
|
|
|
|
require "simplecov"
|
|
|
|
SimpleCov.start
|
|
|
|
end
|
|
|
|
|
2012-12-06 19:52:37 -05:00
|
|
|
class Module
|
|
|
|
public :remove_const
|
|
|
|
public :remove_method
|
|
|
|
end
|
|
|
|
|
2014-03-14 21:22:27 -04:00
|
|
|
Pad = Class.new do
|
|
|
|
include Pry::Config::Behavior
|
|
|
|
end.new(nil)
|
2012-12-08 17:56:57 -05:00
|
|
|
|
2012-12-06 19:52:37 -05:00
|
|
|
# to help with tracking down bugs that cause an infinite loop in the test suite
|
|
|
|
if ENV["SET_TRACE_FUNC"]
|
|
|
|
require 'set_trace' if Pry::Helpers::BaseHelpers.rbx?
|
|
|
|
set_trace_func proc { |event, file, line, id, binding, classname|
|
|
|
|
STDERR.printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
|
|
|
|
}
|
|
|
|
end
|
2012-12-08 20:11:40 -05:00
|
|
|
|
|
|
|
puts "Ruby v#{RUBY_VERSION} (#{defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"}), Pry v#{Pry::VERSION}, method_source v#{MethodSource::VERSION}, CodeRay v#{CodeRay::VERSION}, Slop v#{Slop::VERSION}"
|
Switch test suite to RSpec
Removes Bacon and Mocha
Reasoning explained in this comment: https://github.com/pry/pry/issues/277#issuecomment-51708712
Mostly this went smoothly. There were a few errors that I fixed along
the way, e.g. tests that were failing but for various reasons still
passed. Should have documented them, but didn't think about it until
very near the end. But generaly, I remember 2 reasons this would happen:
`lambda { raise "omg" }.should.raise(RuntimeError, /not-omg/)` will pass
because the second argument is ignored by Bacon. And `1.should == 2`
will return false instead of raising an error when it is not in an it
block (e.g. if stuck in a describe block, that would just return false)
The only one that I felt unsure about was spec/helpers/table_spec.rb
`Pry::Helpers.tablify_or_one_line('head', %w(ing)).should == 'head: ing'`
This is wrong, but was not failing because it was in a describe block
instead of an it block. In reality, it returns `"head: ing\n"`,
I updated the test to reflect this, though I don't know for sure
this is the right thing to do
This will fail on master until https://github.com/pry/pry/pull/1281 is merged.
This makes https://github.com/pry/pry/pull/1278 unnecessary.
2014-08-10 18:26:47 -04:00
|
|
|
|
|
|
|
RSpec.configure do |config|
|
2014-08-18 15:17:18 -04:00
|
|
|
config.expect_with :rspec do |c|
|
|
|
|
c.syntax = [:should, :expect]
|
|
|
|
end
|
2014-09-12 12:42:42 -04:00
|
|
|
|
Switch test suite to RSpec
Removes Bacon and Mocha
Reasoning explained in this comment: https://github.com/pry/pry/issues/277#issuecomment-51708712
Mostly this went smoothly. There were a few errors that I fixed along
the way, e.g. tests that were failing but for various reasons still
passed. Should have documented them, but didn't think about it until
very near the end. But generaly, I remember 2 reasons this would happen:
`lambda { raise "omg" }.should.raise(RuntimeError, /not-omg/)` will pass
because the second argument is ignored by Bacon. And `1.should == 2`
will return false instead of raising an error when it is not in an it
block (e.g. if stuck in a describe block, that would just return false)
The only one that I felt unsure about was spec/helpers/table_spec.rb
`Pry::Helpers.tablify_or_one_line('head', %w(ing)).should == 'head: ing'`
This is wrong, but was not failing because it was in a describe block
instead of an it block. In reality, it returns `"head: ing\n"`,
I updated the test to reflect this, though I don't know for sure
this is the right thing to do
This will fail on master until https://github.com/pry/pry/pull/1281 is merged.
This makes https://github.com/pry/pry/pull/1278 unnecessary.
2014-08-10 18:26:47 -04:00
|
|
|
config.include PryTestHelpers
|
|
|
|
end
|