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

Commit 992711d

Browse files
committed
Add spec to track Ripper support for each Ruby implementation
1 parent 66274b5 commit 992711d

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

spec/rspec/support/ruby_features_spec.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ module Support
9999
::Ripper.lex('foo')
100100
end
101101

102-
if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby'
102+
if Ruby.mri?
103103
context 'on MRI' do
104104
context '1.8.x', :if => RUBY_VERSION.start_with?('1.8.') do
105105
it 'is not supported' do
@@ -115,11 +115,19 @@ module Support
115115
end
116116
end
117117

118-
if defined?(JRUBY_VERSION)
118+
if Ruby.jruby?
119119
context 'on JRuby' do
120120
context '1.7.x', :if => JRUBY_VERSION.start_with?('1.7.') do
121-
it 'is supported' do
122-
expect(line_number).to eq(1)
121+
context 'in 1.8 mode', :if => RUBY_VERSION.start_with?('1.8.') do
122+
it 'is not supported' do
123+
expect { tokens }.to raise_error(LoadError)
124+
end
125+
end
126+
127+
context 'in non 1.8 mode', :unless => RUBY_VERSION.start_with?('1.8.') do
128+
it 'is supported' do
129+
expect(line_number).to eq(1)
130+
end
123131
end
124132
end
125133

0 commit comments

Comments
 (0)