summaryrefslogtreecommitdiff
path: root/spec/ruby/core/kernel/print_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2021-11-29 15:50:28 +0100
committerBenoit Daloze <eregontp@gmail.com>2021-11-29 15:50:28 +0100
commit67a1e2258974df4b597d019739595c18fbb9a7c1 (patch)
tree992ad4fc0fc08a6af8f04373703a339f957eb143 /spec/ruby/core/kernel/print_spec.rb
parente6d93a27afa058319e6dad093bbef637e49fce47 (diff)
Update to ruby/spec@7f22a0b
Diffstat (limited to 'spec/ruby/core/kernel/print_spec.rb')
-rw-r--r--spec/ruby/core/kernel/print_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/ruby/core/kernel/print_spec.rb b/spec/ruby/core/kernel/print_spec.rb
index c8c4453d1e..7e7c9b822d 100644
--- a/spec/ruby/core/kernel/print_spec.rb
+++ b/spec/ruby/core/kernel/print_spec.rb
@@ -5,6 +5,18 @@ describe "Kernel#print" do
it "is a private method" do
Kernel.should have_private_instance_method(:print)
end
+
+ it "delegates to $stdout" do
+ -> { print :arg }.should output("arg")
+ end
+
+ it "prints $_ when no arguments are given" do
+ orig_value = $_
+ $_ = 'foo'
+ -> { print }.should output("foo")
+ ensure
+ $_ = orig_value
+ end
end
describe "Kernel.print" do