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

Commit a0e30cc

Browse files
committed
Update nodes_by_line_number spec for change in Ruby behaviour
1 parent e2b19be commit a0e30cc

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

spec/rspec/support/source_spec.rb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,19 @@ module RSpec::Support
7979
describe '#nodes_by_line_number' do
8080
it 'returns a hash containing nodes for each line number' do
8181
expect(source.nodes_by_line_number).to match(
82-
1 => [
83-
an_object_having_attributes(:type => :@int),
84-
an_object_having_attributes(:type => :@ident)
85-
],
82+
1 =>
83+
if RUBY_VERSION >= '2.6.0'
84+
[
85+
an_object_having_attributes(:type => :@int),
86+
an_object_having_attributes(:type => :@period),
87+
an_object_having_attributes(:type => :@ident)
88+
]
89+
else
90+
[
91+
an_object_having_attributes(:type => :@int),
92+
an_object_having_attributes(:type => :@ident)
93+
]
94+
end,
8695
2 => [
8796
an_object_having_attributes(:type => :@ident),
8897
an_object_having_attributes(:type => :@ident)

0 commit comments

Comments
 (0)