Skip to content

Commit

Permalink
WIP fix for Jruby spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Aug 19, 2024
1 parent 645ae0d commit 118c0f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ group :coverage do
gem 'simplecov', '~> 0.8'
end

if defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java'
gem 'tempfile', require: false
end

if RUBY_VERSION < '2.0.0' || RUBY_ENGINE == 'java'
gem 'json', '< 2.0.0' # is a dependency of simplecov
else
Expand Down
7 changes: 6 additions & 1 deletion spec/rspec/support/spec/stderr_splitter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@

# This is essentially what the `to_stderr_from_any_process` matcher attempts
# to do in CaptureStreamToTempfile.
it 'is able to restore the stream from a cloned StdErrSplitter', :pending => RSpec::Support::Ruby.jruby? do
it 'is able to restore the stream from a cloned StdErrSplitter' do
if RSpec::Support::Ruby.jruby? && Tempfile.new("foo").is_a?(File) == false
require 'tempfile'
expect(Tempfile.new("foo")).to be_a(File)
end

cloned = $stderr.clone
expect($stderr.to_io).not_to be_a(File)

Expand Down

0 comments on commit 118c0f5

Please sign in to comment.