Permalink
Browse files

Spec dash behaviour for padded format directives.

Following JRuby issue jruby/jruby#289, it appears
MRI applies '-' to normally padded format directives.  This added spec
documents this behaviour.
  • Loading branch information...
1 parent eb3cc66 commit 067e12fe6f7fbd272353c9fd124783f9b362b813 @tychobrailleur committed Sep 7, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 core/time/strftime_spec.rb
@@ -288,5 +288,12 @@
time = Time.local(2010,10,10,12,10,42)
time.strftime("%-m/%-d/%-y %-I:%-M %p").should == "10/10/10 12:10 PM"
end
+
+ it "supports the '-' modifier for padded format directives" do
+ time = Time.local(2010, 8, 8, 8, 10, 42)
+ time.strftime("%-e").should == "8"
+ time.strftime("%-k%p").should == "8AM"
+ time.strftime("%-l%p").should == "8AM"
+ end
end
end

0 comments on commit 067e12f

Please sign in to comment.