diff options
Diffstat (limited to 'spec/ruby/library/cgi/print_spec.rb')
-rw-r--r-- | spec/ruby/library/cgi/print_spec.rb | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/spec/ruby/library/cgi/print_spec.rb b/spec/ruby/library/cgi/print_spec.rb index 18ab8d673b..5057c280a0 100644 --- a/spec/ruby/library/cgi/print_spec.rb +++ b/spec/ruby/library/cgi/print_spec.rb @@ -1,26 +1,29 @@ require_relative '../../spec_helper' -require 'cgi' -describe "CGI#print" do - before :each do - ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD'] - @cgi = CGI.new - end +ruby_version_is ""..."3.5" do + require 'cgi' - after :each do - ENV['REQUEST_METHOD'] = @old_request_method - end + describe "CGI#print" do + before :each do + ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD'] + @cgi = CGI.new + end - it "passes all arguments to $stdout.print" do - $stdout.should_receive(:print).with("test") - @cgi.print("test") + after :each do + ENV['REQUEST_METHOD'] = @old_request_method + end - $stdout.should_receive(:print).with("one", "two", "three", ["four", "five"]) - @cgi.print("one", "two", "three", ["four", "five"]) - end + it "passes all arguments to $stdout.print" do + $stdout.should_receive(:print).with("test") + @cgi.print("test") + + $stdout.should_receive(:print).with("one", "two", "three", ["four", "five"]) + @cgi.print("one", "two", "three", ["four", "five"]) + end - it "returns the result of calling $stdout.print" do - $stdout.should_receive(:print).with("test").and_return(:expected) - @cgi.print("test").should == :expected + it "returns the result of calling $stdout.print" do + $stdout.should_receive(:print).with("test").and_return(:expected) + @cgi.print("test").should == :expected + end end end |