spec/ping_spec.rb in httping-1.1.0 vs spec/ping_spec.rb in httping-1.3.0

- old
+ new

@@ -10,11 +10,11 @@ after(:each) do Output.clear end - describe ".ping" do + describe "#ping" do context "a HTTP URI" do it "pings the configured url and outputs statistics" do @httping.ping Output.to_s.should match(/10 bytes from http:\/\/www.example.com\/: code=200 msg=OK time=[0-9] msecs/) end @@ -43,11 +43,11 @@ Output.to_s.should match(/\007/) end end end - context ".count_reached?" do + context "#count_reached?" do it "returns false if a host has not yet been pinged the number of times requested" do 2.times { @httping.ping } @httping.should_not be_count_reached end @@ -55,22 +55,22 @@ 10.times { @httping.ping } @httping.should be_count_reached end end - context ".results" do + context "#results" do before do 5.times { @httping.ping } end it "outputs a summary of the pings" do @httping.results Output.to_s.should match(/-- http:\/\/www.example.com\/ httping.rb statistics ---\n5 GETs transmitted\n/) end end - context ".json_results" do + context "#json_results" do before do @httping.format = :json 2.times { @httping.ping } end @@ -78,11 +78,11 @@ @httping.results Output.to_s.should match(/\{\"results\": \{\"max\": [0-9\.]*, \"avg\": [0-9\.]*, \"min\": [0-9\.]*\}, \"sent\": 2, \"uri\": \"http:\/\/www.example.com\/\"\}/) end end - context ".quick_results" do + context "#quick_results" do before do @httping.format = :quick @httping.ping end @@ -90,10 +90,10 @@ @httping.results Output.to_s.should match(/OK/) end end - context ".run" do + context "#run" do before do @httping = Ping.new @httping.uri = URI.parse("http://www.example.com/") @httping.format = :interactive @httping.count = 5 \ No newline at end of file