8000 Don't reimplement `I18n.with_locale` · bugcrowd/activeadmin@13698f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 13698f1

Browse files
author
David Rodríguez
committed
Don't reimplement I18n.with_locale
1 parent 29267f7 commit 13698f1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

spec/unit/pretty_format_spec.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,8 @@ def method_missing(*args, &block)
4242
end
4343

4444
context "with non-English locale" do
45-
before do
46-
@previous_locale = I18n.locale.to_s
47-
I18n.locale = "es"
48-
end
49-
after do
50-
I18n.locale = @previous_locale
45+
around do |example|
46+
I18n.with_locale(:es) { example.call }
5147
end
5248
it "should return a localized Date or Time with long format for non-english locale" do
5349
t = Time.utc(1985, "feb", 28, 20, 15, 1)

0 commit comments

Comments
 (0)
0