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

Merge pull request #1968 from pry/spec-helper-improvements

Spec helper improvements
This commit is contained in:
Kyrylo Silin 2019-03-08 00:39:41 +02:00 committed by GitHub
commit 2d5572dcfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 9 deletions

2
.rspec
View file

@ -1,2 +1,2 @@
--color
--require helper
--require spec_helper

View file

@ -65,11 +65,11 @@ describe Pry::Code do
end
it 'finds files in a relative directory with `.rb` extension' do
expect(Pry::Code.from_file('../helper.rb').code_type).to eq :ruby
expect(Pry::Code.from_file('../spec_helper.rb').code_type).to eq :ruby
end
it 'finds files in a relative directory with `.rb` omitted' do
expect(Pry::Code.from_file('../helper').code_type).to eq :ruby
expect(Pry::Code.from_file('../spec_helper').code_type).to eq :ruby
end
it "doesn't confuse files with the same name, but without an extension" do

View file

@ -1,5 +1,3 @@
require_relative 'helper'
describe Pry::Ring do
let(:ring) { described_class.new(3) }

View file

@ -2,8 +2,10 @@ require 'bundler/setup'
Bundler.require :default, :test
require 'pry/testable'
require 'English'
require_relative 'spec_helpers/mock_pry'
require_relative 'spec_helpers/repl_tester'
Dir['./spec/support/**/*.rb'].map do |file|
require file
end
if ENV["COVERAGE"]
require "simplecov"
@ -11,8 +13,11 @@ if ENV["COVERAGE"]
end
class Module
# False positive: https://github.com/rubocop-hq/rubocop/issues/5953
# rubocop:disable Style/AccessModifierDeclarations
public :remove_const
public :remove_method
# rubocop:enable Style/AccessModifierDeclarations
end
Pad = Class.new do

View file

@ -1,7 +1,6 @@
# This is for super-high-level integration testing.
require 'delegate'
# This is for super-high-level integration testing.
class ReplTester
class Input
def initialize(tester_mailbox)