Skip to content

Commit c0bf28d

Browse files
k0kubunheadius
authored andcommitted
Reapply "[ruby/erb] Reapply "Remove safe_level and further positional"
This reverts commit 5b6658a406b5f1c535aed4cb68e8e18a3cbabb81. With a ruby spec fix.
1 parent 1db4d53 commit c0bf28d

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

library/erb/new_spec.rb

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,19 @@
139139
->{ ERB.new("<%= list %>").result }.should raise_error(NameError)
140140
end
141141

142-
describe "warning about arguments" do
143-
it "warns when passed safe_level and later arguments" do
144-
-> {
145-
ERB.new(@eruby_str, nil, '%')
146-
}.should complain(/warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments./)
147-
end
148-
149-
it "does not warn when passed arguments as keyword argument" do
150-
-> {
151-
ERB.new(@eruby_str, trim_mode: '%')
152-
}.should_not complain(/warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments./)
142+
version_is ERB::VERSION, ""..."5.1.3" do # TODO: bump 5.1.3 to 6.0.0 once released
143+
describe "warning about arguments" do
144+
it "warns when passed safe_level and later arguments" do
145+
-> {
146+
ERB.new(@eruby_str, nil, '%')
147+
}.should complain(/warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments./)
148+
end
149+
150+
it "does not warn when passed arguments as keyword argument" do
151+
-> {
152+
ERB.new(@eruby_str, trim_mode: '%')
153+
}.should_not complain(/warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments./)
154+
end
153155
end
154156
end
155157
end

0 commit comments

Comments
 (0)