Skip to content

Commit

Permalink
Time.gm|.utc: Update for 1.9 change in return val.
Browse files Browse the repository at this point in the history
  • Loading branch information
runpaint committed Jun 5, 2009
1 parent add3f62 commit b39aec5
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions core/time/shared/gm.rb
@@ -1,10 +1,23 @@
describe :time_gm, :shared => true do
it "creates a time based on given values, interpreted as UTC (GMT)" do
Time.send(@method, 2000,"jan",1,20,15,1).inspect.should == "Sat Jan 01 20:15:01 UTC 2000"
ruby_version_is ""..."1.9" do
it "creates a time based on given values, interpreted as UTC (GMT)" do
Time.send(@method, 2000,"jan",1,20,15,1).inspect.should == "Sat Jan 01 20:15:01 UTC 2000"
end

it "creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT)" do
time = Time.send(@method, 1, 15, 20, 1, 1, 2000, :ignored, :ignored, :ignored, :ignored)
time.inspect.should == "Sat Jan 01 20:15:01 UTC 2000"
end
end

it "creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT)" do
time = Time.send(@method, 1, 15, 20, 1, 1, 2000, :ignored, :ignored, :ignored, :ignored)
time.inspect.should == "Sat Jan 01 20:15:01 UTC 2000"
ruby_version_is "1.9" do
it "creates a time based on given values, interpreted as UTC (GMT)" do
Time.send(@method, 2000,"jan",1,20,15,1).inspect.should == "2000-01-01 20:15:01 UTC"
end

it "creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT)" do
time = Time.send(@method, 1, 15, 20, 1, 1, 2000, :ignored, :ignored, :ignored, :ignored)
time.inspect.should == "2000-01-01 20:15:01 UTC"
end
end
end

0 comments on commit b39aec5

Please sign in to comment.