<commit_before>describe WebStub::API do
  before do
    WebStub::API.reset_stubs
    
    @url = "http://www.google.com/search"
    @request = NSURLRequest.requestWithURL(NSURL.URLWithString(@url))
  end

  describe ".stub_request" do
    it "returns the newly added stub" do
      WebStub::API.stub_request(:get, @url).should.not.be.nil
    end
    
    before { WebStub::API.disable_network_access! }
    after  { WebStub::API.enable_network_access! }

    describe "when a request does not match any previously set stubs" do
      describe "when no body is set" do
        before do
          @response = get @url
        end

        it "returns a nil body" do
          @response.body.should.be.nil
        end

        it "returns an error with a description of the problem" do
          @response.error.localizedDescription.should.not.be.empty
        end
      end

      describe "when a body is set" do<commit_msg>Use www.example.com as test domain<commit_after>describe WebStub::API do
  before do
    WebStub::API.reset_stubs
    
    @url = "http://www.example.com/"
    @request = NSURLRequest.requestWithURL(NSURL.URLWithString(@url))
  end

  describe ".stub_request" do
    it "returns the newly added stub" do
      WebStub::API.stub_request(:get, @url).should.not.be.nil
    end
    
    before { WebStub::API.disable_network_access! }
    after  { WebStub::API.enable_network_access! }

    describe "when a request does not match any previously set stubs" do
      describe "when no body is set" do
        before do
          @response = get @url
        end

        it "returns a nil body" do
          @response.body.should.be.nil
        end

        it "returns an error with a description of the problem" do
          @response.error.localizedDescription.should.not.be.empty
        end
      end

      describe "when a body is set" do
{'fraction_non_alphanumeric': 0.08798283261802575, 'fraction_numerical': 0.0, 'mean_word_length': 2.409506398537477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5727305', 'n_tokens_mistral': 561, 'n_tokens_neox': 562, 'n_words': 167}