Skip to content

Commit

Permalink
Enable natural assertions for JRuby 1.7.5
Browse files Browse the repository at this point in the history
JRuby 1.7.5 finally has a Ripper compatible library, so we are
enabling natural assertions for JRuby. Let the rejoicing begin!
  • Loading branch information
jimweirich committed Aug 31, 2013
1 parent 8d13004 commit d1d61d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/given/module_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ module Given
# Does this platform support natural assertions?
RBX_IN_USE = (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx')
JRUBY_IN_USE = defined?(JRUBY_VERSION)
OLD_JRUBY_IN_USE = JRUBY_IN_USE && (JRUBY_VERSION < '1.7.5')

NATURAL_ASSERTIONS_SUPPORTED = ! (JRUBY_IN_USE || RBX_IN_USE)
NATURAL_ASSERTIONS_SUPPORTED = ! (OLD_JRUBY_IN_USE || RBX_IN_USE)

def self.framework
@_gvn_framework
Expand Down

1 comment on commit d1d61d4

@nirvdrum
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the direction JRuby is heading with version numbers, this may not be a problem, but comparing version numbers like this has a tendency to break down the line. E.g., a JRuby 1.7.10 release or a 1.10.x release would both get miscategorized as an old JRuby version. I've found Gem::Version.new(X) < Gem::Version.new(Y) works pretty well, but could be a tad confusing here since you're not really comparing gem versions -- just something that follows that same versioning scheme.

Please sign in to comment.