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

Commit 118c0f5

Browse files
committed
WIP fix for Jruby spec
1 parent 645ae0d commit 118c0f5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ group :coverage do
5151
gem 'simplecov', '~> 0.8'
5252
end
5353

54+
if defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java'
55+
gem 'tempfile', require: false
56+
end
57+
5458
if RUBY_VERSION < '2.0.0' || RUBY_ENGINE == 'java'
5559
gem 'json', '< 2.0.0' # is a dependency of simplecov
5660
else

spec/rspec/support/spec/stderr_splitter_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@
101101

102102
# This is essentially what the `to_stderr_from_any_process` matcher attempts
103103
# to do in CaptureStreamToTempfile.
104-
it 'is able to restore the stream from a cloned StdErrSplitter', :pending => RSpec::Support::Ruby.jruby? do
104+
it 'is able to restore the stream from a cloned StdErrSplitter' do
105+
if RSpec::Support::Ruby.jruby? && Tempfile.new("foo").is_a?(File) == false
106+
require 'tempfile'
107+
expect(Tempfile.new("foo")).to be_a(File)
108+
end
109+
105110
cloned = $stderr.clone
106111
expect($stderr.to_io).not_to be_a(File)
107112

0 commit comments

Comments
 (0)