|
18 | 18 | end |
19 | 19 | end |
20 | 20 |
|
21 | | - context 'for a beginless inclusive range' do |
22 | | - it 'returns a Hash with key :irange and the upper bounding type' do |
23 | | - input = '..1.2' |
24 | | - output = { irange: [NilClass, Float]} |
25 | | - expect(input).to be_parsed_as output |
| 21 | + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0') |
| 22 | + context 'for a beginless inclusive range' do |
| 23 | + it 'returns a Hash with key :irange and the upper bounding type' do |
| 24 | + input = '..1.2' |
| 25 | + output = { irange: [NilClass, Float]} |
| 26 | + expect(input).to be_parsed_as output |
| 27 | + end |
26 | 28 | end |
27 | | - end |
28 | 29 |
|
29 | | - context 'for a beginless exclusive range' do |
30 | | - it 'returns a Hash with key :erange and the upper bounding type' do |
31 | | - input = '...1.2' |
32 | | - output = { erange: [NilClass, Float]} |
33 | | - expect(input).to be_parsed_as output |
| 30 | + context 'for a beginless exclusive range' do |
| 31 | + it 'returns a Hash with key :erange and the upper bounding type' do |
| 32 | + input = '...1.2' |
| 33 | + output = { erange: [NilClass, Float]} |
| 34 | + expect(input).to be_parsed_as output |
| 35 | + end |
34 | 36 | end |
35 | 37 | end |
36 | 38 |
|
37 | | - context 'for a endless inclusive range' do |
38 | | - it 'returns a Hash with key :irange and the lower bounding type' do |
39 | | - input = '1.2..' |
40 | | - output = { irange: [Float, NilClass]} |
41 | | - expect(input).to be_parsed_as output |
| 39 | + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6.0') |
| 40 | + context 'for a endless inclusive range' do |
| 41 | + it 'returns a Hash with key :irange and the lower bounding type' do |
| 42 | + input = '1.2..' |
| 43 | + output = { irange: [Float, NilClass]} |
| 44 | + expect(input).to be_parsed_as output |
| 45 | + end |
42 | 46 | end |
43 | | - end |
44 | 47 |
|
45 | | - context 'for a endless exclusive range' do |
46 | | - it 'returns a Hash with key :erange and the lower bounding type' do |
47 | | - input = '1.2...' |
48 | | - output = { erange: [Float, NilClass]} |
49 | | - expect(input).to be_parsed_as output |
| 48 | + context 'for a endless exclusive range' do |
| 49 | + it 'returns a Hash with key :erange and the lower bounding type' do |
| 50 | + input = '1.2...' |
| 51 | + output = { erange: [Float, NilClass]} |
| 52 | + expect(input).to be_parsed_as output |
| 53 | + end |
50 | 54 | end |
51 | 55 | end |
52 | 56 | end |
|
0 commit comments