@@ -74,24 +74,32 @@ def metadata(source)
74
74
hook ( source ) . metadata . to_s
75
75
end
76
76
77
+ if RUBY_VERSION >= '3.4'
78
+ let ( :expected_special ) { 's(:sym, :special) => true' }
79
+ let ( :expected_symbol ) { 's(:sym, :symbol) => true' }
80
+ else
81
+ let ( :expected_special ) { 's(:sym, :special)=>true' }
82
+ let ( :expected_symbol ) { 's(:sym, :symbol)=>true' }
83
+ end
84
+
77
85
it 'extracts symbol metadata' do
78
86
expect ( metadata ( 'before(:example, :special) { foo }' ) )
79
- . to eq ( '{s(:sym, :special)=>true}' )
87
+ . to eq ( "{ #{ expected_special } }" )
80
88
end
81
89
82
90
it 'extracts hash metadata' do
83
91
expect ( metadata ( 'before(:example, special: true) { foo }' ) )
84
- . to eq ( '{s(:sym, :special)=>true}' )
92
+ . to eq ( "{ #{ expected_special } }" )
85
93
end
86
94
87
95
it 'combines symbol and hash metadata' do
88
96
expect ( metadata ( 'before(:example, :symbol, special: true) { foo }' ) )
89
- . to eq ( '{s(:sym, :symbol)=>true, s(:sym, :special)=>true}' )
97
+ . to eq ( "{ #{ expected_symbol } , #{ expected_special } }" )
90
98
end
91
99
92
100
it 'extracts hash metadata with no scope given' do
93
101
expect ( metadata ( 'before(special: true) { foo }' ) )
94
- . to eq ( '{s(:sym, :special)=>true}' )
102
+ . to eq ( "{ #{ expected_special } }" )
95
103
end
96
104
97
105
it 'withstands no arguments' do
0 commit comments