Skip to content

Commit e11cbf6

Browse files
committed
{Time,Date}#asctime should have the specs and #ctime be the alias
1 parent 924151c commit e11cbf6

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

core/time/asctime_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
require_relative '../../spec_helper'
22

33
describe "Time#asctime" do
4-
it "is an alias of Time#ctime" do
5-
Time.instance_method(:asctime).should == Time.instance_method(:ctime)
4+
it "returns a canonical string representation of time" do
5+
t = Time.now
6+
t.asctime.should == t.strftime("%a %b %e %H:%M:%S %Y")
67
end
78
end

core/time/ctime_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
require_relative '../../spec_helper'
22

33
describe "Time#ctime" do
4-
it "returns a canonical string representation of time" do
5-
t = Time.now
6-
t.ctime.should == t.strftime("%a %b %e %H:%M:%S %Y")
4+
it "is an alias of Time#asctime" do
5+
Time.instance_method(:ctime).should == Time.instance_method(:asctime)
76
end
87
end

library/date/asctime_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
require 'date'
33

44
describe "Date#asctime" do
5-
it "needs to be reviewed for spec completeness"
5+
it "returns a canonical string representation of date" do
6+
d = Date.today
7+
d.asctime.should == d.strftime("%a %b %e %H:%M:%S %Y")
8+
end
69
end

0 commit comments

Comments
 (0)