request succeeds" do before do expect(http_client) .to_receive(:head) .with("...") end it "returns true" do expect(subject.is_it_up?).to be true end end end end
request fails" do before do expect(http_client) .to_receive(:head) .and_raise(NetworkError) end it "returns false" do expect(subject.is_it_up?).to be false end end end end