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

add rbx-3.86, add Pry::Platform.known_engines, allow expected failures in spec suite (#1694)

* Add Pry::Platform.known_engines

* Add fixes for rbx-3.86, and cleanup .travis.yml

* Optionally skip a test on specific Ruby engine(s).
   And tag specs that currently do not pass on Rubinius.

Travis takes much longer to complete after this change.
Maybe there are switches we can pass to speed up Rubinius,
or this will improve on new versions of Rubinius.
This commit is contained in:
r-obert 2017-11-18 20:54:03 +01:00 committed by GitHub
parent 3bd43b9db4
commit 3499b21a02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 45 additions and 16 deletions

View file

@ -5,10 +5,9 @@ rvm:
- 2.2
- 2.3
- 2.4
- ruby-head
- rbx-3.69
- rbx-3.86
- jruby-9.1.14.0
- jruby
- ruby-head
- jruby-head
install:
@ -23,9 +22,7 @@ sudo: false
matrix:
allow_failures:
- rvm: ruby-head
- rvm: jruby
- rvm: jruby-head
- rvm: rbx-3.69
- rvm: 2.4 # https://bugs.ruby-lang.org/issues/13537
notifications:

View file

@ -2,6 +2,11 @@
#### Features
* Add Pry::Platform#known_engines, returns an Array of Ruby engines
(MRI, JRuby, Rubinius) that Pry is known to run on.
See pull request [#1694](https://github.com/pry/pry/pull/1694).
* Deprecate Pry::Command#text. Please use black(), white(), etc directly
instead (as you would with helper functions from BaseHelpers and
CommandHelpers)
@ -50,6 +55,14 @@ See pull request [#1691](https://github.com/pry/pry/pull/1691).
See pull request [#1674](https://github.com/pry/pry/pull/1674).
#### Pry developers
* Optionally skip a spec on specific Ruby engine(s) by providing `expect_failure: [:mri, :jruby]`
as a metadata Hash to the example group.
See pull request [#1694](https://github.com/pry/pry/pull/1694).
### 0.11.0
* Add alias 'whereami[?!]+' for 'whereami' command. ([#1597](https://github.com/pry/pry/pull/1597))

View file

@ -90,4 +90,12 @@ module Pry::Platform
def mri_2?
!!(mri? and RUBY_VERSION =~ /\A2/)
end
#
# @return [Array<Symbol>]
# Returns an Array of Ruby engines that Pry is known to run on.
#
def known_engines
[:jruby, :rbx, :mri]
end
end

View file

@ -20,7 +20,7 @@ describe "save-file" do
@t.eval("save-file '#{path}' --to '#{@path}'")
expect(File.read(@path)).to eq(File.read(path))
end
end
@ -141,7 +141,7 @@ describe "save-file" do
end
describe "saving commands" do
it 'should save a command to a file' do
it 'should save a command to a file', expect_failure: [:rbx] do
@t.eval "save-file --to '#{@path}' show-source"
cmd_source = Pry.config.commands["show-source"].source
expect(File.read(@path)).to eq(cmd_source)

View file

@ -623,13 +623,13 @@ describe "show-source" do
end
describe "when current context is a C object" do
it "should display a warning, and not monkey-patched definition" do
it "should display a warning, and not monkey-patched definition", expect_failure: [:rbx] do
out = pry_eval([1, 2, 3], 'show-source')
expect(out).not_to match(/doge/)
expect(out).to match(/warning/i)
end
it "recommends to use the --all switch when other candidates are found" do
it "recommends to use the --all switch when other candidates are found", expect_failure: [:rbx] do
out = pry_eval([], 'show-source')
expect(out).to match(/'--all' switch/i)
end

View file

@ -42,6 +42,17 @@ RSpec.configure do |config|
config.include Pry::Testable::Utility
include Pry::Testable::Evalable
include Pry::Testable::Variables
# Optionally skip a test on specific Ruby engine(s).
# Please use this feature sparingly! It is better that a feature works than not.
# Inapplicable features are OK.
config.before(:each) do |example|
Pry::Platform.known_engines.each do |engine|
example.metadata[:expect_failure].to_a.include?(engine) and
Pry::Platform.public_send(:"#{engine}?") and
skip("This spec is failing or inapplicable on #{engine}.")
end
end
end
puts "Ruby v#{RUBY_VERSION} (#{defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"}), Pry v#{Pry::VERSION}, method_source v#{MethodSource::VERSION}, CodeRay v#{CodeRay::VERSION}, Pry::Slop v#{Pry::Slop::VERSION}"

View file

@ -175,13 +175,13 @@ describe Pry::Hooks do
describe "getting hooks" do
describe "get_hook" do
it 'should return the correct requested hook' do
run = false
fun = false
@hooks.add_hook(:test_hook, :my_name) { run = true }
@hooks.add_hook(:test_hook, :my_name2) { fun = true }
run1 = false
run2 = false
@hooks.add_hook(:test_hook, :my_name) { run1 = true }
@hooks.add_hook(:test_hook, :my_name2) { run2 = true }
@hooks.get_hook(:test_hook, :my_name).call
expect(run).to eq true
expect(fun).to eq false
expect(run1).to eq true
expect(run2).to eq false
end
it 'should return nil if hook does not exist' do

View file

@ -37,7 +37,7 @@ describe Pry do
end
end
it "should not load the pryrc if pryrc's directory permissions do not allow this" do
it "should not load the pryrc if pryrc's directory permissions do not allow this", expect_failure: [:rbx] do
Dir.mktmpdir do |dir|
File.chmod 0000, dir
Pry::LOCAL_RC_FILE.replace File.join(dir, '.pryrc')