summaryrefslogtreecommitdiff
path: root/spec/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/core/time/localtime_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/ruby/core/time/localtime_spec.rb b/spec/ruby/core/time/localtime_spec.rb
index 56c9d37bc8..5592150ca2 100644
--- a/spec/ruby/core/time/localtime_spec.rb
+++ b/spec/ruby/core/time/localtime_spec.rb
@@ -90,6 +90,19 @@ describe "Time#localtime" do
t.utc_offset.should == -18000
end
+
+ it "does nothing if already in a local time zone" do
+ time = with_timezone("America/New_York") do
+ break Time.new(2005, 2, 27, 22, 50, 0)
+ end
+ zone = time.zone
+
+ with_timezone("Europe/Amsterdam") do
+ time.localtime
+ end
+
+ time.zone.should == zone
+ end
end
describe "with an argument that responds to #to_str" do