Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Updates from rspec-dev (2016-07-14) #291

Merged
merged 7 commits into from
Jul 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop_rspec_base.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2016-06-14T22:22:15-07:00 from the rspec-dev repo.
# This file was generated on 2016-07-14T09:50:14+10:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

# This file contains defaults for RSpec projects. Individual projects
Expand Down
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2016-06-14T22:22:15-07:00 from the rspec-dev repo.
# This file was generated on 2016-07-14T09:50:14+10:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

language: ruby
Expand All @@ -22,6 +22,7 @@ rvm:
- 2.1
- 2.2.5
- 2.3.1
- 2.4.0-preview1
- ruby-head
- ree
- rbx
Expand All @@ -35,11 +36,14 @@ matrix:
env: JRUBY_OPTS='--server -Xcompile.invokedynamic=false'
- rvm: jruby
env: JRUBY_OPTS='--server -Xcompile.invokedynamic=false'
- rvm: jruby-9.1.2.0
env: JRUBY_OPTS='--server -Xcompile.invokedynamic=false'
allow_failures:
- rvm: jruby-head
env: JRUBY_OPTS='--server -Xcompile.invokedynamic=false'
- rvm: ruby-head
- rvm: rbx
- rvm: 2.4.0-preview1
fast_finish: true
branches:
only:
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ end
### dep for ci/coverage
gem 'simplecov', '~> 0.8'

if RUBY_VERSION < '2.0.0' || RUBY_ENGINE == 'java'
gem 'json', '< 2.0.0'
end

gem 'rubocop', "~> 0.23.0", :platform => [:ruby_19, :ruby_20, :ruby_21]

eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2016-06-14T22:22:15-07:00 from the rspec-dev repo.
# This file was generated on 2016-07-14T09:50:14+10:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

version: "{build}"
Expand Down
4 changes: 4 additions & 0 deletions lib/rspec/support/ruby_features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def jruby?
RUBY_PLATFORM == 'java'
end

def jruby_9000?
jruby? && JRUBY_VERSION >= '9.0.0.0'
end

def rbx?
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
end
Expand Down
4 changes: 3 additions & 1 deletion lib/rspec/support/spec/shell_out.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def strip_known_warnings(input)
# Ignore bundler + rubygems warning.
l =~ %r{site_ruby/\d\.\d\.\d/rubygems} ||
# This is required for windows for some reason
l =~ %r{lib/bundler/rubygems}
l =~ %r{lib/bundler/rubygems} ||
# This is a JRuby file that generates warnings on 9.0.3.0
l =~ %r{lib/ruby/stdlib/jar}
end.join("\n")
end

Expand Down
2 changes: 1 addition & 1 deletion script/clone_all_rspec_repos
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2016-06-14T22:22:15-07:00 from the rspec-dev repo.
# This file was generated on 2016-07-14T09:50:14+10:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

set -e
Expand Down
2 changes: 1 addition & 1 deletion script/functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2016-06-14T22:22:15-07:00 from the rspec-dev repo.
# This file was generated on 2016-07-14T09:50:14+10:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand Down
2 changes: 1 addition & 1 deletion script/predicate_functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2016-06-14T22:22:15-07:00 from the rspec-dev repo.
# This file was generated on 2016-07-14T09:50:14+10:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

function is_mri {
Expand Down
2 changes: 1 addition & 1 deletion script/run_build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2016-06-14T22:22:15-07:00 from the rspec-dev repo.
# This file was generated on 2016-07-14T09:50:14+10:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

set -e
Expand Down
2 changes: 1 addition & 1 deletion script/travis_functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2016-06-14T22:22:15-07:00 from the rspec-dev repo.
# This file was generated on 2016-07-14T09:50:14+10:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

# Taken from:
Expand Down
2 changes: 1 addition & 1 deletion spec/rspec/support/encoded_string_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module RSpec::Support
end

# See JRuby issue https://github.com/jruby/jruby/issues/2580
it 'replaces invalid byte sequences with the REPLACE string', :pending => RSpec::Support::Ruby.jruby? do
it 'replaces invalid byte sequences with the REPLACE string', :pending => RSpec::Support::Ruby.jruby? && !RSpec::Support::Ruby.jruby_9000? do
resulting_string = build_encoded_string(string, target_encoding).to_s
replacement = EncodedString::REPLACE * 3
expected_string = "I have a bad byt#{replacement}".force_encoding(target_encoding)
Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/support/method_signature_verifier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def arity_kw(x, y:1, z:2); end
expect(valid?(nil, :a => 1)).to eq(false)
end

it 'mentions the invalid keyword args in the error', :pending => RUBY_ENGINE == 'jruby' do
it 'mentions the invalid keyword args in the error', :pending => RSpec::Support::Ruby.jruby? && !RSpec::Support::Ruby.jruby_9000? do
expect(error_for(nil, :a => 0, :b => 1)).to \
eq("Invalid keyword arguments provided: a, b")
end
Expand All @@ -308,7 +308,7 @@ def arity_kw(x, y:1, z:2); end
expect(args).to eq([nil, { :y => 1 }])
end

it 'mentions the arity and optional kw args in the description', :pending => RUBY_ENGINE == 'jruby' do
it 'mentions the arity and optional kw args in the description', :pending => RSpec::Support::Ruby.jruby? && !RSpec::Support::Ruby.jruby_9000? do
expect(signature_description).to eq("arity of 1 and optional keyword args (:y, :z)")
end

Expand Down
18 changes: 17 additions & 1 deletion spec/rspec/support/ruby_features_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ module Support
expect(Ruby).to_not be_rbx
end

specify "jruby_9000? reflects the state of RUBY_PLATFORM and JRUBY_VERSION" do
stub_const("RUBY_PLATFORM", "java")
stub_const("JRUBY_VERSION", "")
expect(Ruby).to_not be_jruby_9000
stub_const("JRUBY_VERSION", "9.0.3.0")
expect(Ruby).to be_jruby_9000
stub_const("RUBY_PLATFORM", "")
expect(Ruby).to_not be_jruby_9000
end

specify "rbx? reflects the state of RUBY_ENGINE" do
hide_const("RUBY_ENGINE")
expect(Ruby).to be_mri
Expand Down Expand Up @@ -131,11 +141,17 @@ module Support
end
end

context '9.x.x.x', :if => JRUBY_VERSION.start_with?('9.') do
context '9.0.x.x', :if => JRUBY_VERSION.start_with?('9.0') do
it 'reports wrong line number' do
expect(line_number).to eq(2)
end
end

context '9.1.x.x', :if => JRUBY_VERSION.start_with?('9.1') do
it 'is supported' do
expect(line_number).to eq(1)
end
end
end
end
end
Expand Down