mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@ec84479
This commit is contained in:
parent
296f68816c
commit
f234d51eab
50 changed files with 739 additions and 377 deletions
|
@ -336,6 +336,12 @@ describe :kernel_sprintf, shared: true do
|
|||
@method.call("%s", obj)
|
||||
}.should raise_error(NoMethodError)
|
||||
end
|
||||
|
||||
it "formats a partial substring without including omitted characters" do
|
||||
long_string = "aabbccddhelloddccbbaa"
|
||||
sub_string = long_string[8, 5]
|
||||
sprintf("%.#{1 * 3}s", sub_string).should == "hel"
|
||||
end
|
||||
end
|
||||
|
||||
describe "%" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue