diff options
Diffstat (limited to 'spec/ruby/core/kernel/print_spec.rb')
-rw-r--r-- | spec/ruby/core/kernel/print_spec.rb | 12 |
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 |