aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/library/datetime/to_s_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/datetime/to_s_spec.rb')
-rw-r--r--spec/ruby/library/datetime/to_s_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/ruby/library/datetime/to_s_spec.rb b/spec/ruby/library/datetime/to_s_spec.rb
index 893cc93283..9d9dfc629f 100644
--- a/spec/ruby/library/datetime/to_s_spec.rb
+++ b/spec/ruby/library/datetime/to_s_spec.rb
@@ -2,5 +2,16 @@ require File.expand_path('../../../spec_helper', __FILE__)
require 'date'
describe "DateTime#to_s" do
- it "needs to be reviewed for spec completeness"
+ it "returns a new String object" do
+ dt = DateTime.new(2012, 12, 24, 1, 2, 3, "+03:00")
+ dt.to_s.should be_kind_of(String)
+ end
+
+ it "maintains timezone regardless of local time" do
+ dt = DateTime.new(2012, 12, 24, 1, 2, 3, "+03:00")
+
+ with_timezone("Pactific/Pago_Pago", -11) do
+ dt.to_s.should == "2012-12-24T01:02:03+03:00"
+ end
+ end
end