summaryrefslogtreecommitdiff
path: root/spec/ruby/library/net-http/http/started_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/net-http/http/started_spec.rb')
-rw-r--r--spec/ruby/library/net-http/http/started_spec.rb26
1 files changed, 24 insertions, 2 deletions
diff --git a/spec/ruby/library/net-http/http/started_spec.rb b/spec/ruby/library/net-http/http/started_spec.rb
index cbb82ceefa..a0b46fcbd2 100644
--- a/spec/ruby/library/net-http/http/started_spec.rb
+++ b/spec/ruby/library/net-http/http/started_spec.rb
@@ -1,8 +1,30 @@
require_relative '../../../spec_helper'
require 'net/http'
require_relative 'fixtures/http_server'
-require_relative 'shared/started'
describe "Net::HTTP#started?" do
- it_behaves_like :net_http_started_p, :started?
+ before :each do
+ NetHTTPSpecs.start_server
+ @http = Net::HTTP.new("localhost", NetHTTPSpecs.port)
+ end
+
+ after :each do
+ @http.finish if @http.started?
+ NetHTTPSpecs.stop_server
+ end
+
+ it "returns true when self has been started" do
+ @http.start
+ @http.started?.should == true
+ end
+
+ it "returns false when self has not been started yet" do
+ @http.started?.should == false
+ end
+
+ it "returns false when self has been stopped again" do
+ @http.start
+ @http.finish
+ @http.started?.should == false
+ end
end