Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 067e12fe6f7fbd272353c9fd124783f9b362b813 1 parent eb3cc66
@tychobrailleur tychobrailleur authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 core/time/strftime_spec.rb
View
7 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
Please sign in to comment.
Something went wrong with that request. Please try again.