<commit_before>require File.expand_path('spec_helper', File.dirname(__FILE__))
require 'nokogiri'

shared_examples_for "session" do
  def extract_results(session)
    YAML.load Nokogiri::HTML(session.body).xpath("//pre[@id='results']").first.text
  end

  describe '#app' do
    it "should remember the application" do
      @session.app.should == TestApp
    end
  end

  describe '#visit' do
    it "should fetch a response from the driver" do
      @session.visit('/')<commit_msg>Don't use wait time in session specs<commit_after>require File.expand_path('spec_helper', File.dirname(__FILE__))
require 'nokogiri'

shared_examples_for "session" do
  def extract_results(session)
    YAML.load Nokogiri::HTML(session.body).xpath("//pre[@id='results']").first.text
  end

  # These specs do nothing asynchronous, timeout just slows us down.
  before do
    Capybara.default_wait_time = 0
  end

  after do
    Capybara.default_wait_time = 1
  end

  describe '#app' do
    it "should remember the application" do
      @session.app.should == TestApp
    end
  end

  describe '#visit' do
    it "should fetch a response from the driver" do
      @session.visit('/')
{'fraction_non_alphanumeric': 0.11158798283261803, 'fraction_numerical': 0.0017167381974248926, 'mean_word_length': 3.8786610878661087, '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': '7208341', 'n_tokens_mistral': 381, 'n_tokens_neox': 362, 'n_words': 103}