<commit_before>import Ember from 'ember';
import Adapter from 'gatemedia-data/utils/adapter';
import repr from 'gatemedia-ext/utils/ember/repr';

/* global QUnit, ok */

function extractURL (fullUrl) {
  return (/http(s?):\/\/(.+?)\/(.+)/).exec(fullUrl).get('lastObject');
}


var RequestHandler = Ember.Object.extend({
  verb: null,
  path: null,
  params: null,
  result: null,
  assertionsCallback: null,
  consumed: false,

  doneHandler: null,
  failHandler: null,

  match: function (settings) {
    if (this.get('consumed')) {
      return false;
    }

    var requestPath = extractURL(settings.url),
        requestMatch = (settings.type === this.get('verb')) && (requestPath === this.get('path')),
        expectedParams = this.get('params'),
        paramsMatch = true;

    if (requestMatch && expectedParams) {<commit_msg>Improve stubbing support<commit_after>import Ember from 'ember';
import Adapter from 'gatemedia-data/utils/adapter';
import repr from 'gatemedia-ext/utils/ember/repr';

/* global QUnit, ok */

function extractURL (fullUrl) {
  return (/(?:http(s?):\/\/(.+?))?\/(.+)/).exec(fullUrl).get('lastObject');
}


var RequestHandler = Ember.Object.extend({
  verb: null,
  path: null,
  params: null,
  result: null,
  assertionsCallback: null,
  consumed: false,

  doneHandler: null,
  failHandler: null,

  match: function (settings) {
    if (this.get('consumed')) {
      return false;
    }

    var requestPath = extractURL(settings.url),
        requestMatch = (settings.type === this.get('verb')) && (requestPath === this.get('path')),
        expectedParams = this.get('params'),
        paramsMatch = true;

    if (requestMatch && expectedParams) {
{'fraction_non_alphanumeric': 0.16785290628706998, 'fraction_numerical': 0.0, 'mean_word_length': 3.647382920110193, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3791686', 'n_tokens_mistral': 553, 'n_tokens_neox': 535, 'n_words': 124}