mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@f8a2d54
This commit is contained in:
parent
ed377cc9aa
commit
809f0b8a13
76 changed files with 2451 additions and 224 deletions
|
@ -1,7 +1,6 @@
|
|||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/sprintf'
|
||||
require "stringio"
|
||||
|
||||
describe "Kernel#printf" do
|
||||
it "is a private method" do
|
||||
|
@ -32,8 +31,14 @@ describe "Kernel.printf" do
|
|||
object.should_receive(:write).with("string")
|
||||
Kernel.printf(object, "%s", "string")
|
||||
end
|
||||
end
|
||||
|
||||
describe "Kernel.printf" do
|
||||
describe "formatting" do
|
||||
before :each do
|
||||
require "stringio"
|
||||
end
|
||||
|
||||
context "io is specified" do
|
||||
it_behaves_like :kernel_sprintf, -> format, *args {
|
||||
io = StringIO.new
|
||||
|
@ -45,7 +50,6 @@ describe "Kernel.printf" do
|
|||
context "io is not specified" do
|
||||
it_behaves_like :kernel_sprintf, -> format, *args {
|
||||
stdout = $stdout
|
||||
|
||||
begin
|
||||
$stdout = io = StringIO.new
|
||||
Kernel.printf(format, *args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue