<commit_before>require 'spec_helper'
require_relative '../../api/api'
require 'rack/test'
set :environment, :test
set :run, false
set :raise_errors, true
set :logging, false

def app
    Sinatra::Application
end

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.include Rack::Test::Methods
end

describe "segmenter api" do
  describe '/segment' do
    context "with URI as input" do
      it "responds to GET" do
        get '/segment'
        last_response.should be_ok
      end
    end

    let(:text) {{text: "homo mittit. Marcus est."}}
<commit_msg>Include rack test methods in describe block instead of reconfiguring rspec.<commit_after>require 'spec_helper'
require_relative '../../api/api'
require 'rack/test'
set :environment, :test
set :run, false
set :raise_errors, true
set :logging, false

def app
    Sinatra::Application
end

describe "segmenter api" do
  include Rack::Test::Methods

  describe '/segment' do
    context "with URI as input" do
      it "responds to GET" do
        get '/segment'
        last_response.should be_ok
      end
    end

    let(:text) {{text: "homo mittit. Marcus est."}}

{'fraction_non_alphanumeric': 0.10024057738572574, 'fraction_numerical': 0.0, 'mean_word_length': 3.5714285714285716, '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': '3265895', 'n_tokens_mistral': 396, 'n_tokens_neox': 387, 'n_words': 128}