-
Notifications
You must be signed in to change notification settings - Fork 45
Fix a failing test #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit fixes the following failure: ``` 1) Failure: Fiddle::TestImport#test_no_message_with_debug [/Users/mrkn/src/github.com/ruby/fiddle/test/fiddle/test_import.rb:152]: 1. [2/2] Assertion for "stderr" | <[]> expected but was | <["Exception `NameError' at /Users/mrkn/.rbenv/versions/2.5.1/lib/ruby/2.5.0/fiddle/import.rb:157 - uninitialized constant Fiddle::Function::STDCALL"]>. ```
|
|
|
I suspect that this failure is caused by a bug in bundler; bundler/setup.rb enables bundler even if rubygems is disabled. |
|
@nobu I just remove |
|
Oh... |
|
How about disabling all This works even if a developer has the following ugly $ cat /tmp/warn.rb
$, = "XXX"
$ RUBYOPT=-r/tmp/warn.rb rakediff --git a/test/fiddle/test_import.rb b/test/fiddle/test_import.rb
index 99294ea..db58a82 100644
--- a/test/fiddle/test_import.rb
+++ b/test/fiddle/test_import.rb
@@ -149,7 +149,21 @@ module Fiddle
end
def test_no_message_with_debug
- assert_in_out_err(%w[--debug --disable=gems -rfiddle/import], 'p Fiddle::Importer', ['Fiddle::Importer'])
+ # disable all Ruby environment variables
+ orig_RUBYOPT, ENV['RUBYOPT'] = ENV['RUBYOPT'], nil
+ orig_RUBYLIB, ENV['RUBYLIB'] = ENV['RUBYLIB'], nil
+ libdir = File.expand_path('../../../lib', __FILE__)
+ assert_in_out_err([
+ "--debug",
+ "--disable=gems",
+ "-I#{libdir}",
+ "-rfiddle/import",
+ ],
+ 'p Fiddle::Importer',
+ ['Fiddle::Importer'])
+ ensure
+ ENV['RUBYLIB'] = orig_RUBYLIB
+ ENV['RUBYOPT'] = orig_RUBYOPT
end
end
end if defined?(Fiddle) |
|
@kou thanks for your advice. |
kou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
The first element of |
|
!!! |
This reverts commit 5ebb0d50f6560b35bc03deb79341a115c5f782ee.
This commit fixes the following failure: