Skip to content

Commit dc4e588

Browse files
committed
Suppress warnings in the added specs
1 parent 4ed331b commit dc4e588

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spec/ruby/core/module/const_added_spec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,12 @@ def self.const_added(name)
147147
end
148148
end
149149

150-
mod.module_eval(<<-RUBY, __FILE__, __LINE__ + 1)
151-
TEST = 123
152-
TEST = 456
153-
RUBY
150+
-> {
151+
mod.module_eval(<<-RUBY, __FILE__, __LINE__ + 1)
152+
TEST = 123
153+
TEST = 456
154+
RUBY
155+
}.should complain(/warning: already initialized constant .+::TEST/)
154156

155157
ScratchPad.recorded.should == [123, 456]
156158
end

0 commit comments

Comments
 (0)