Skip to content

Commit

Permalink
Don't add a new value to ENV if 'LC_ALL' doesn't exist to begin with.
Browse files Browse the repository at this point in the history
  • Loading branch information
BanzaiMan committed Jul 17, 2010
1 parent 4d94329 commit 11c6c8f
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions core/encoding/locale_charmap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
old_lc_all = ENV['LC_ALL']
ENV['LC_ALL'] = 'C'
ruby_exe("print Encoding.locale_charmap").should == 'ANSI_X3.4-1968'
ENV['LC_ALL'] = old_lc_all
if old_lc_all == nil
ENV.delete('LC_ALL')
else
ENV['LC_ALL'] = old_lc_all
end
end
end

Expand All @@ -21,7 +25,11 @@
old_lc_all = ENV['LC_ALL']
ENV['LC_ALL'] = 'C'
ruby_exe("print Encoding.locale_charmap").should == 'US-ASCII'
ENV['LC_ALL'] = old_lc_all
if old_lc_all == nil
ENV.delete('LC_ALL')
else
ENV['LC_ALL'] = old_lc_all
end
end
end

Expand All @@ -31,7 +39,11 @@
old_lc_all = ENV['LC_ALL']
ENV['LC_ALL'] = 'C'
Encoding.locale_charmap.should == old_charmap
ENV['LC_ALL'] = old_lc_all
if old_lc_all == nil
ENV.delete('LC_ALL')
else
ENV['LC_ALL'] = old_lc_all
end
end
end
end
Expand Down

0 comments on commit 11c6c8f

Please sign in to comment.