Browse Source

Fix condition

`defined? RUBY_ENGINE && RUBY_ENGINE == 'jruby'` is always truthy
because it's parsed as `defined?(RUBY_ENGINE && RUBY_ENGINE == 'jruby')`

```
$ docker run --rm ruby:2.4-alpine ruby -e "p (defined? RUBY_ENGINE && RUBY_ENGINE == 'jruby')"
"expression"
```

```
$ docker run --rm ruby:2.4-alpine ruby -e "p (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')"
false
```
Fumiaki MATSUSHIMA 8 years ago
parent
commit
a607e87313
1 changed files with 1 additions and 1 deletions
  1. 1 1
      test/tests/ruby-standard-libs/container.rb

+ 1 - 1
test/tests/ruby-standard-libs/container.rb

@@ -96,7 +96,7 @@ stdlib = [
 	'zlib',
 ]
 
-if defined? RUBY_ENGINE && RUBY_ENGINE == 'jruby'
+if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
 	# these libraries don't work or don't exist on JRuby ATM
 	stdlib.delete('dbm')
 	stdlib.delete('gdbm')