1 require File.dirname(__FILE__) + '/../../../spec_helper'
3 require File.dirname(__FILE__) + '/fixtures/http_server'
5 describe "Net::HTTP.get_print when passed URI" do
7 NetHTTPSpecs.start_server
11 NetHTTPSpecs.stop_server
14 it "it prints the body of the specified uri to $stdout" do
15 $stdout.should_receive(:print).with("")
16 $stdout.should_receive(:print).with("This is the index page.")
17 Net::HTTP.get_print URI.parse('http://localhost:3333/')
21 describe "Net::HTTP.get_print when passed host, path, port" do
23 NetHTTPSpecs.start_server
27 NetHTTPSpecs.stop_server
30 it "it prints the body of the specified uri to $stdout" do
31 $stdout.should_receive(:print).with("")
32 $stdout.should_receive(:print).with("This is the index page.")
33 Net::HTTP.get_print 'localhost', "/", 3333